//元素上移(把第i个元素上移)void sift_up(int h[],int i){bool done=false;if(i != 1){while(!done && i !=1){if(h[i]>[i/2]) swap(h[i],h[i/2]);else done=true;i=i/2;}}}这只是部分代码...谁能教我写出完整代码?要可以运行的包含有main()函数
holdtom
相关分类