The following table shows the complexities for searching algorithms:
Algorithm | Data Structure | Worst Cases |
Sequential search | Array | O(n) |
Binary search | Sorted array | O(log(n)) |
Interpolation search | Sorted array | O(n) |
Depth-first search (DFS) | Graph of |V| vertices and |E| edges | O(|V| + |E|) |
Breadth-first search (BFS) | Graph of |V| vertices and |E| edges | O(|V| + |E|) |