- 0
- 0
- 约1.7千字
- 约 6页
- 2026-01-21 发布于江西
- 举报
*high_node,//fromlastnodewithNULLrightchild
*low_node;//candidateforrightchildofhighnode
if(highnode-right!=NULL)
voidmove(intcount,intstart,intfinish,inttemp)
{
if(count0){
口
coutMovediskcountfromstart
tofinish
口
end!;
:,.根据课本内容补全如下Trio的插入insert程序代码。
压or_codeTrie::insert(constRecorlnew_entry)
/*Post:IftheKeyofnew_entryisalreadyintheTrie,acodeofduplicate_errorisreturned.Otherwise,acoleofsuccessisreturnedandtheRecordnewentryisinsertedintotheTrie.*/
{
Error_coderesult=success;
if(root==NULL)root=newTrie_node;IICreateanewemptyTrie.
intposition=O;//indexeslettersofnewentry
charnext_char;
Tric_node*location=root;//movesthroughtheTrie
while(ncxt_char=-new_entry.key_letter(position)!=\O){
intnext_position=alphabetic_order(next_char);
if(
【5】
)location-hranch[next_position]==newTrie_node;
location=location-branch[next_positionJ;
position叶;
if(
【6】
)result=duplicateerror;
elselocation-data=newRecord(new_entry);
returnresult;
?,
和序分析题(20分,
每题5分)
lS)的伯。
根据如F递I门程序代码,给出表达式rune(12,
intPunc(inli,intj){
if(i1I)
ifUll)
return1+J:
else
returnj-1「unc(i,j?2);
else
returni+Func(i-1,j);
2.分别给出下图从顶点0出发的庥度优先遍历序列和广度优先遍历厅列。
2。
St叩
5
6
7
3
.3A,
将如下的序列插入到-棵空的AVL树中后,Z,B,Y,C,X,D,W,E,V,r
给出该树的前序,中序,后序
4.解释B树的定义,;并给出如T寸名列插入-颗空的厅为5的B树的图示过程。a,g气t:b,k,d,h,m,j,e,s,i,r,x气C,I,11,t,U
5给出如下厅列插入一个空的小根堆(根最小)的图示过程。括入完成后,给出删除根以后的新堆的形态u
10,12,l,14,6,5,8,15,3,9,4,11,13,2
并
6.木良才居如卜的有向图,给出从顶点()分别到其他顶点的最短路径以及数们
10
9
4
6
勹
4
intdata;
Node*next;
您可能关注的文档
- 2023年重庆大学《数据结构》期末练习题1.docx
- 2023年重庆大学《数据结构》期末练习题3.docx
- 安徽大学《数据结构》2017-2018学年期末试卷.docx
- 安徽大学《数据结构》2018-2019学年期末试卷.docx
- 安徽大学《数据结构》2019-2020学年期末试卷.docx
- 安徽大学《数据结构》2020-2021学年期末试卷.docx
- 安徽大学《数据结构》2021-2022学年期末试卷.docx
- 安徽大学《运筹学》2018-2019学年期末试卷.docx
- 北京大学《数据结构》2022-2023学年期末试卷.docx
- 北京大学《数据结构与算法》2018-2019学年 期末试卷.docx
- 新教材人教版八年级英语下册习题课件Unit 3 Growing Up.pptx
- 新教材人教版八年级数学下册习题课件第二十三章 一次函数.pptx
- 人教版二年级数学上册第三单元1-6的表内除法PPT.pptx
- 新教材人教版八年级数学下册第二十一章四边形(前三节).pptx
- 新教材人教版八年级英语下册习题课件Unit 6 Crossing Cultures.pptx
- 新教材人教版八年级数学下册期末复习课件.pptx
- 新人教版三年级数学上册第五单元线和角.pptx
- 新教材人教版八年级数学下册习题课件第二十一章 四边形.pptx
- 新教材华师版八年级数学下册期末专题复习课件.pptx
- 新教材人教版八年级数下册第二十三章 一次函数.pptx
原创力文档

文档评论(0)