Searching

If you have a small list to search, you will probably settle for the straightforward linear search. For larger, sorted lists, the binary search is much faster. You can use the binary search tree for both sorting and rapid searching. For the shortest search times, consider placing data using a hashing algorithm, then use the same algorithm to find the data.

Follow the links below for demonstrations of the linear search (also called a sequential search), the binary search of sorted lists, searching using a binary search tree (which has already been sorted) and the rapid search of a random file by hashing.

Programming - a skill for life!

Quicksort, bubble, insertion and tree sort, binary search tree and linear, binary and hash search