2017-02-11 57 views
0

我剛剛提出了這種排序算法,它不同於我在互聯網上找到的其他選擇種類。這可以被認爲是一種選擇排序?這是一個多種排序嗎?

for(mindex = 0; mindex < length; mindex++) { 

    for(index = mindex + 1; index < length; index++) { 
     if(array[mindex] > array[index]) { 
      int temp = array[mindex]; 
      array[mindex] = array[index]; 
      array[index] = temp; 
     }//End of swap 
    }//End of index loop 
}//End of main loop 
+0

看起來像bubblesort-ish。 – mroman

回答

0

這與選擇排序類似。你只是做了很多額外的掉期,這可能會讓它變慢。