Please enable JavaScript.
Coggle requires JavaScript to display documents.
Sorting Algorithms - Coggle Diagram
Sorting Algorithms
Insertion sort
Each item in an unordered list is taken in turn, compared to the items in an ordered list and placed in the correct position.
-
-
-
Bubble sort
Bubble sort is moving through a list repeatedly, swapping items that are in the wrong order
-
-
Usually involves several passes, each pass involves several comparisons and possible swaps
Merge sort
a list is repeatedly split into sub lists, these are then merged (2 sub lists at a time).
Merge sort is a divide and conquer algorithm because it divides the items into sub lists and then merges them
-
-
-
Descending order
Highest to lowest e.g. 10-1, Z-A
-
-
Ascending order
Lowest to highest e.g. 1-10, A-Z
-
-
Merge sort disadvantages
for short data sets it is slower than other algorithms, it is the most difficult to code
-
-
-
-
Merge
put 2 sub lists together, ensuring that all the values are in the correct order
-
-
Worst case scenario
The items are in the exactly opposite order of how you want them. Eg they are in descending order and you want them in ascending order