JAVA Development: Extra: Sorting Algorithms
JAVA Development: Extra: Sorting Algorithms
38, 27, 43, 3, 9, 82, 10 the first element is taken as the start
27, 38, 43, 3, 9, 82, 10 27 is moved on the first position, being smaller than 38
27, 38, 43, 3, 9, 82, 10 43 is kept on his position, being greater than 38
3, 27, 38, 43, 9, 82, 10 3 is inserted in the right position, the other elements are
shifted across to make room and keep the sort ordered
3, 9, 27, 38, 43, 82, 10 9 is inserted after 3, and all the rest of the numbers are
shifted across to keep the sort ordered
3, 9, 27, 38, 43, 82, 10 keep 82 on his position. No shifted needed
3, 9, 10, 27, 38, 43, 82 insert 10 on the right position and shift all the numbers
after it in order to keep the sort ordered
Binary search
Merge Sort
https://www.geeksforgeeks.org/sorting-algorithms/#algo
https://visualgo.net/bn/sorting