Explore tens of thousands of sets crafted by our community.
Common Searching Techniques
5
Flashcards
0/5
Linear Search
Linear search iterates over all elements in a list sequentially until the target is found or the list ends. Complexity: O(n)
Interpolation Search
Interpolation search calculates an estimated position of the target based on the values of boundaries and the target value, assuming a uniform distribution of values within the interval. Complexity: Average O(log(log n)), Worst O(n)
Binary Search
Binary search divides the search interval in half with each step, requiring the data to be sorted before searching. Complexity: O(log n)
Depth-First Search (DFS)
DFS explores as far as possible along each branch before backtracking, typically implemented using recursion or a stack. Complexity: O(V + E) for graphs
Breadth-First Search (BFS)
BFS visits neighbors level by level, exploring the graph in layers using a queue. Complexity: O(V + E) for graphs
© Hypatia.Tech. 2024 All rights reserved.