ch4

Bubble sort:

  • least efficient, organizes one pair of things over and over until everything is sorted

Want to alphabetize collection if books on zombies

  • Look at the shelf for books starting with A, look at the first 2 items already there, then check the list for any other books with starting with A and compare them against the pair of books with A alphabet you just sorted, do it until you sort all the books.

Insertion sort

Take all the books out and put them back one by one ensuring they are in right place

Merge sort

Divide the books into multiple piles, sort each piles from A to Z and then put them back

Last updated