Uses
Sorting algorithim
Used to rearrange a given array or list elements according to a comparison operator on the elements.
Uses
Comparision operator
Used to decide the new order of element in the respective data structure.
Define
Merge sort
A merge sort is a complex sorting algorithm, but it is also a highly efficient one.
How does it work
Merge sort
How does it work
Bubble sort
Advantages/Disadvantages
Insertion sort
An insertion sort is less complex and efficient than a merge sort, but more efficient than a bubble sort.
How does it work
Insertion sort
An insertion sort compares values in turn, starting with the second value in the list.
If this value is greater than the value to the left of it, no changes are made.
Otherwise this value is repeatedly moved left until it meets a value that is less than it.
The sort process then starts again with the next value.
This continues until the end of the list is reached.