当前位置:首页 > 搜索 "程序填空题"
程序填空题:小顶堆的指定删除
下列代码的功能是从小顶堆`H`中删除指定位置`p`上的元素,然后继续调整为小顶堆。```c++Deletion(PriorityQueueH,intp)/*deletetheelementH-˃Elements[p......
程序填空题:层序遍历
下列代码的功能是将二叉树`T`中的结点按照层序遍历的顺序输出。```c++typedefstructTreeNode*Tree;structTreeNode{intKey;TreeLeft;TreeRig......
程序填空题:另类选择排序
下列代码的功能是将一列元素{`r[1]…r[n]`}按其键值`key`的非递减顺序排序。普通选择排序是每次仅将一个待排序列的最小元放到正确的位置上,而这个另类的选择排序是每次从待排序列中同时找到最小元和最大元,把它们放到最终的正......
程序填空题:大顶堆的下滤
下列代码的功能是从一个大顶堆`H`的某个指定位置`p`开始执行下滤。```c++voidPercolateDown(intp,PriorityQueueH){intchild;ElementTypeTmp=......
程序填空题:Shellsort Runs
ShowtheresultofrunningShellsortontheinput9,8,7,6,5,4,3,2,1usingtheincrements{1,3,7}.Pleasefill......
程序填空题:二叉树的宽度
下列代码的功能是计算给定二叉树`T`的宽度。二叉树的宽度是指各层结点数的最大值。函数`Queue_rear`和`Queue_front`分别返回当前队列`Q`中队尾和队首元素的位置。```c++typedefstructTreeNode.....
程序填空题:拓扑排序
下列代码的功能是对一个给定的图`G`执行拓扑排序,其中`TopNum[]`从1开始记录拓扑序。```c++voidTopsort(GraphG){QueueQ;VertexV,W;NodePtrptr;......
程序填空题:希尔排序的分步结果
本题要求给出希尔排序对给定初始序列{9,8,7,6,5,4,3,2,1}利用增量序列{1,3,7}进行排序的分步结果。将每步结果填在下列空中。注意:相邻数字间必须有一个空格,开头结尾不得有多余空格。|原始序列|98......
程序填空题:Reverse Linked List
Thefunctionistoreturnthereverselinkedlistof`L`,withadummyheader.```c++ListReverse(ListL){Position......
程序填空题:输出字符串1
打印“HelloWorld!”,占一行。```c++#includeusingnamespacestd;intmain(){cout˂˂"@@[HelloWorld!](10)"˂˂endl;return0;}......
程序填空题:单链表逆转
下列代码的功能是返回带头结点的单链表`L`的逆转链表。```c++ListReverse(ListL){PositionOld_head,New_head,Temp;New_head=NULL;Ol......
程序填空题:IncreaseKey
Thefunctionistoincreasethevalueoftheintegerkeyatposition`P`byapositiveamount`D`inamax-heap`H`.```c......
程序填空题:MaxHeap Deletion
Pleasefillintheblanksintheprogramwhichdeletesagivenelementatposition`p`fromamax-heap`H`.```c++Deletio......
程序填空题:大顶堆键值上调
下列代码的功能是将大顶堆`H`中指定位置`P`上的元素的整数键值上调`D`个单位,然后继续将`H`调整为大顶堆。```c++voidIncreaseKey(intP,intD,PriorityQueueH){inti......
程序填空题:大顶堆的指定删除
下列代码的功能是从大顶堆`H`中删除指定位置`p`上的元素,然后继续调整为大顶堆。```c++Deletion(PriorityQueueH,intp)/*deletetheelementH-˃Elements[p......
程序填空题:并查运算
本题要求给出下列并查集操作执行后,集合数组内存储的结果。```union(find(2),find(7))union(find(3),find(5))union(find(0),find(2))union(find(5)......
程序填空题:Union / Find
Pleasefillthearraywiththeresultsafterthefollowingunion/findoperations.```union(find(2),find(7))union(find......
程序填空题:Union - Find
Pleasefillthearraywiththeresultsafterthefollowingunion/findoperations.```union(find(4),find(6))union(find......
程序填空题:并--查运算
本题要求给出下列并查集操作执行后,集合数组内存储的结果。```union(find(1),find(5))union(find(3),find(6))union(find(0),find(1))union(find(6)......
程序填空题:Union--Find
Pleasefillthearraywiththeresultsafterthefollowingunion/findoperations.```union(find(1),find(5))union(find......