Sorting Notes
Sorting Notes
- toString()
- Selection sort
- Linear sort algorithm as it moves from index of 0 to index of n-1
- In the inner loop which is a second linear loop it compares two elements and notes which is smallest, after cycling to the end it swaps the smallest number to beginning position in the round.
- Big O Complexity n squared
- Insertion Sort
- Sorts loop partially at a time until the whole list is sorted
- Big O Complexity n squared
- Merge Sort
- Divides the array into two different groups recursively
- Big O Complexity nlog(n)