Searching for information is a basic task that we all do. We search for an item in a grocery list, or look for a telephone number from the telephone directory. A common and popular example of searching is Google search where we search for links to web sites such as Notesformsc, or look for specific images, text and so on.
The searching techniques differ depending on the type of data where we are performing the search. Your goal is to get the information as fast as possible and this is due to enormous repository of information available today.
Searching And Data Structures
Searching techniques have very close relationship with data structures. The data structure influence the choice of search techniques. Therefore, we classify data structures into following classes.
When the data structure is in the form of lists than we can use following type of searches algorithms.
- Linear search or sequential search
- Transpose sequential search
- Interpolation search
- Binary search
- Fibonacci search
The non-linear data structures are trees like binary search trees, AVL trees, etc or you have graphs to search. There are hash tables which also introduce some interesting search techniques. A tree search can employ recursive or iterative search within the tree.
For graph based data structures, the following algorithms are very popular.
- Breadth first search
- Depth first search
Files And Databases
Database searches are done on large volume of data.The data is stored in files and indexed with key/value pair that assist in quick searches. These kind of searches are called indexed sequential searches.
In this section, we will be discussing about various search algorithms and their performances.