DOCTYPE html> Search algorithms.
Learn-dsa..in 30 days!



























Search algorithms.

Searching algorithms search for a particular element within a list of data. The algorithms check if the element exists within the target data list and return its index/position.

Searching algorithms list:

Linear search.
Jump search.
Exponential search.
Binary search.
DFS search.
BFS search.
Ternary search.
Interpolation search.
Hash search.
Fibonacci search.

Time Complexity of Search Algoriths

Following table shows time complexity metrics for an String with n characters:

Operation Best case Worst case Average case
Linear Search O(n) O(n) O(n)
Binary Search O(1) O(log n) O(log n)
Depth First Search (DFS) O(V) O(V + E) O(V + E)
Breadth First Search O(V) O(V + E) O(V + E)
Ternary Search O(1) O(log3 n) O(log3 n)
Jump Search O(√n) O(√n)
Interpolation Search O(1) O(n) O(log n)
Exponential Search O(1) O(log n) O(log n)
Fibonacci Search O(1) O(log n)

Note:
n: Number of elements in the dataset.
V: Number of vertices in the graph.
E: Number of edges in the graph.