Searching Algorithms

Searching for data is one of the basic operations of computing.

Linear Search

 

This content is no longer updated!

2016 Eduqas Spec

2020 Eduqas Spec

A linear search is the most simple search algorithm. Each data item is searched in order from the first value to the last as if they were all laid out in a line. The list does not have to be in any order before it is searched. This search is also known as a sequential search because the list is searched in a sequence from start to end. For large lists, this search is not very efficient

 

Binary Search

A binary search is a much more efficient searching algorithm as it generally searches through fewer data and is often much quicker - especially for large data sets. In a binary search, the middle point of the data is selected with each iteration and many data items can be ignored. However, the list of data must already be sorted in order before a binary search can take place. 

Questo's Corner

Searching Algorithms:

a. Describe step-by-step how the numbers '32, 16, 04, 08, 22, 11' can be searched for the number 16 using linear search.

b. Describe step-by-step how the numbers '32, 16, 04, 08, 22, 11' can be searched for the number 16 using binary search. (You will have to sort them first)

© CSNewbs 2020