December 2015
Intermediate to advanced
416 pages
7h 15m
English
CHAPTER 18
![]()
Sorting
Binary searches only work on lists that are in order. So how do programs get a list in order? How does a program sort a list of items when the user clicks a column heading or otherwise needs something sorted?
There are several algorithms that do this. The two easiest algorithms for sorting are the selection sort and the insertion sort. Other sorting algorithms exist as well, such as the shell, merge, heap, and quick sorts.
The best way to get an idea on how these sorts work is to watch them. To see common sorting algorithms in action visit this excellent web site:
http://www.sorting-algorithms.com
Each sort has advantages ...
Read now
Unlock full access