文件名称:堆排序用c#
文件大小:15KB
文件格式:DOCX
更新时间:2017-08-12 08:36:02
c# 排序
namespace ConsoleApplication17 { class Program { static void Main(string[] args) { int[] a = { 22, 33, 4, 7, 0, 88, 78 }; minheapsort(a); Console.WriteLine(string.Join(",",a)); } private static int [] minheapsort(int[] a) { bulidminheap(a); int temp1; for (int i=a.Length-1;i>0; i--) { temp1= a[0]; a[0] = a[i]; a[i] = temp1;