Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         Debug.Log("aaaaaaaaaaaaaaaaaaa");
         List <int> temp = new List <int>();
         temp.AddRange(data);
         PerformanceHelper.WatchPerformance("归并排序算法效率  ", () => { MergeSortHelper.Sort <int>(data, 0, data.Count - 1, CompareRather, temp); });
     }
 }
Ejemplo n.º 2
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.B))
     {
         PerformanceHelper.WatchPerformance("快速排序算法效率  ", () => { QuickSortHelper.Sort <int>(data2, 0, numberCount - 1, rather, less); });
         for (int dex = 0; dex < data.Count; ++dex)
         {
             if (IsExit(data[dex]) == false)
             {
                 Debug.LogError("Not Exit " + data[dex]);
             }
         }
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.B))
        {
            Debug.Log("BBBBBBBBBBBBBBBBBBBBB");

            PerformanceHelper.WatchPerformance("堆排序算法效率  ", () => { HeapSortHelper.Sort <int>(data2, (a, b) => { return(a < b); }); });

            //for (int dex = 0; dex < numberCount; ++dex)
            //{
            //    Debug.Log("End ; " + data[dex]);
            //}
        }
    }