Sorting Algorithm
1. Permutation Sort
1) Find the all the permutations for the given list
2) Pick one permutation
3) Check whether it is sorted. If the given list is a sorted one, return the list

Example
1.[1,2,3] is given
2.Possible Permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]
3.Pick one permutation: [1,3,2]
=>No, not sorted.
4.Pick one permutation: [1,2,3]
=>Yes, it is sorted => return [1,2,3]

Implementation
https://gist.github.com/growingpenguin/b5e3730e4f04b30e2d6aa60957209953

2. Selection Sort

Professor Description (Recitation2) 1) Find the biggest with index <= i 2) Swap 3) Sort 1…i-1 It is usually called the prefix max function to find the biggest element of the array between index 0 and index i.
Professor code (Recitation2)

Example

  1. 7 1 3 8 2

Implementation
https://gist.github.com/growingpenguin/58b21a8fe8743642a724de6f55fb5b55

3. Insertion Sort
Implementation
https://gist.github.com/growingpenguin/d845a69964587406e6dfa245e4e7a1b8
4. Merge Sort
geekforgeeks MergeSort
Example

  1. (6) (0) (4) (5) (1) (3) (8) (2)
  2. Merge
    (6, 0) (4, 5) (1, 3) (8, 2)
  3. Sort
    (0, 6) (4, 5) (1, 3) (2, 8)
  4. Merge
    (0, 6, 4, 5) (1, 3, 2, 8)
  5. Sort
    (0, 4, 5, 6) (1, 2, 3, 8)
  6. Merge
    (0, 4, 5, 6, 1, 2, 3, 8)
  7. Sort
    (0, 1, 2, 3, 4, 5, 6, 8)

Implementation
https://gist.github.com/growingpenguin/fd2880f24745c4e32663892913094da1