General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
LoneTech
TED-Ed
comments
Comments by "LoneTech" (@0LoneTech) on "TED-Ed" channel.
Insertion sort doesn't require you to do a linear scan to find the insertion place. Since the section wherein we need to insert a book is sorted, the place can be found by bisection, for instance with a binary or golden ratio search. In fact, the insertion sort shown was merely doing the same sort of shortcut on the bubble sort that let you skip comparing to the last book in the second iteration (which is the selection sort aspect of the bubble sort); the difference was bubbling in the opposite direction of the original scan. If we're doing bubble sort variants there's no cause to avoid the bidirectional bubble sort. Also, in practice you might do a merge sort for the example, rather than start by comparing any particular book against all the others. It lends itself better to dividing work.
1
Wild orangutans have been known to use boats to go fishing and help humans with laundry.
1