数据结构中堆排序的C编程实现.docVIP

  • 1
  • 0
  • 约2.07千字
  • 约 6页
  • 2022-09-01 发布于浙江
  • 举报
数据结构中堆排序的C编程实现 #includestdio.h #includestdlib.h #define max 100 //函数声明 void Print(int heap[]); void Choose(int choice, int heap[]); void HeapSort(int heap[],int length); void CreateHeap(int heap[],int length); void sift(int heap[],int k,int m); void PrintHeap(int heap[],int length); //主函数 int main() { int heap[max]; system(color a); Print(heap); while(true) { printf(Press enter to continue....); getchar(); getchar(); system(cls); Print(heap); }return 0; } //菜单函数 void Print(int heap[]) { int choice; printf(\n); printf(1.输入一个新序列并进行堆排序.\n); printf(2.输出当前堆的序列.\n); pri

文档评论(0)

1亿VIP精品文档

相关文档