Searching Algorithms


Linear search

We often need to find one particular item of data amongst many hundreds, thousands, millions or more. For example, you might need to find someone’s phone number on your phone, or particular business’s address in the UK.


This is why searching algorithms are important. Without them you would have to look at each item of data – each phone number or business address – individually, to see whether it is what you are looking for. In a large set of data, it will take a long time to do this. Instead, a searching algorithm can be used to help find the item of data you are looking for.



Binary Search:  

Binary search is a faster method for searching for an item that is in an ordered list.An ordered list is one where the sequence of items in the list is important.An ordered list does not necessarily contain a sequence of numbers (eg 1, 2, 3, 4) or characters (eg A, B, C, D). It might also contain, eg a list of names in alphabetical order, a list of files from smallest to largest or a list of records from earliest to most recent.

Comments