Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Common Searching Techniques

5

Flashcards

0/5

Still learning
StarStarStarStar

Linear Search

StarStarStarStar

Linear search iterates over all elements in a list sequentially until the target is found or the list ends. Complexity: O(n)

StarStarStarStar

Interpolation Search

StarStarStarStar

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)

StarStarStarStar

Binary Search

StarStarStarStar

Binary search divides the search interval in half with each step, requiring the data to be sorted before searching. Complexity: O(log n)

StarStarStarStar

Depth-First Search (DFS)

StarStarStarStar

DFS explores as far as possible along each branch before backtracking, typically implemented using recursion or a stack. Complexity: O(V + E) for graphs

StarStarStarStar

Breadth-First Search (BFS)

StarStarStarStar

BFS visits neighbors level by level, exploring the graph in layers using a queue. Complexity: O(V + E) for graphs

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.