鲜衣怒马少年时一...吧 关注:17贴子:1,233
  • 13回复贴,共1


1楼2017-05-24 23:59回复
    linear sort / nlogn sort(quick sort)
    https://users.encs.concordia.ca/~sthiel/comp352/03_Linear_Sorting.pdf


    2楼2017-05-25 00:02
    回复
      2026-06-24 19:22:45
      广告
      不感兴趣
      开通SVIP免广告
      selection sort
      https://www.javatpoint.com/selection-sort-in-java


      3楼2017-05-25 00:04
      收起回复
        Sifting
        I。 walk up the list
        I 。where you are at in the list is current position
        I 。everything before current position must be in order
        I 。put current position in order
        I。 advance current position
        I 。things put in order by swapping


        4楼2017-05-25 00:07
        回复
          insertion sort
          https://www.javatpoint.com/insertion-sort-in-java


          5楼2017-05-25 00:08
          回复
            public class SelectionSortExample {
            public static void selectionSort(int[] arr){
            for (int i = 0; i < arr.length - 1; i++)
            {
            int index = i;
            for (int j = i + 1; j < arr.length; j++){
            if (arr[j] < arr[index]){
            index = j;//searching for lowest index
            }
            }
            int smallerNumber = arr[index];
            arr[index] = arr[i];
            arr[i] = smallerNumber;
            }
            }


            6楼2017-05-25 00:12
            收起回复
              public class InsertionSortExample {
              public static void insertionSort(int array[]) {
              int n = array.length;
              for (int j = 1; j < n; j++) {
              int key = array[j];
              int i = j-1;
              while ( (i > -1) && ( array [i] > key ) ) {
              array [i+1] = array [i];
              i--;
              }
              array[i+1] = key;
              }
              }


              7楼2017-05-25 00:17
              回复
                bubble sort
                https://www.javatpoint.com/bubble-sort-in-java


                8楼2017-05-25 00:32
                回复
                  2026-06-24 19:16:45
                  广告
                  不感兴趣
                  开通SVIP免广告
                  merge sort simple alg and piece of pseudo code
                  https://www.youtube.com/watch?v=iMT7gTPpaqw


                  9楼2017-05-25 03:04
                  回复
                    quick sort simple alg and piece of pseudo code and big oh
                    https://www.youtube.com/watch?v=B4URnLNITgw


                    10楼2017-05-25 03:09
                    回复
                      11楼2017-05-25 03:13
                      回复
                        How to Program quick Sort
                        https://www.youtube.com/watch?v=0agWhWeYB8Q


                        12楼2017-05-25 03:16
                        回复