1/8
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
How do you perform a bubble sort
Look at the first two items in the list
If they’re in the right order, don’t do anything. If they’re in the wrong order, swap them
Move on to the next pair of items and repeat step 2
Repeat step 3 until you get to the end of the list
Repeat steps 1-4 until there are no swaps in a pass
what are the advantages of bubble sort
Its a simple algorithm than can be easily implemented on a computer
Its an efficient wat to check if a list is already in order
Doesn’t use very much memory as all the sorting is done using the original list
what are the disadvantages of bubble sort
its an inefficient way to sort a list
does not cope well with very large lists of items
How do you perform a merge sort
split the list in half
keep repeating step 2 until all lists only contain one item
merge pairs of sub lists so that each sub lists has twice as many items. Each time you merge the sub-lists, sort the items into the right order
repeat step 3 until all sub-lists are merged together
what are the benefits of merge sort
more efficient and quicker than bubble sort and insertion sort for large lists
has a very consistent running time regardless of how ordered the items in the original list are
what are the disadvantages of Merge sort
its slower than other algorithms for small lists
even if the lists is already sorted it still goes through the whole splitting and merging process
it uses more memory than the other sorting algorithms in order to create the separate lists
how do you perform an insertion sort
look at the second item in the list
compare it to all items before it and insert the number into the right place
repeat steps 2 for all the items in the list so they are all sorted
what are the advantages of insertion sort
can be easily coded
copes very well with small lists
all sorting is done on the original list so it doesn’t require very much additional memory
very quick to add items to an already sorted list
very quick at checking a list that is already sorted
what is the main disadvantage of insertion sort
doesnt cope very well with very large lists