Search Algorithms
Everything on SkillVeris tagged Search Algorithms — collected across the glossary, study notes, blog, and cheat sheets.
12 resources across 1 library
Interview Questions(12)
What is a Trie?
A trie, or prefix tree, is a tree-based data structure that stores strings character by character along shared paths, letting you search, insert, and check pre…
What is Binary Search?
Binary search is an algorithm that finds a target value in a sorted collection by repeatedly halving the search range, comparing the target to the middle eleme…
N-Queens Problem: How Would You Solve It?
The N-Queens problem is solved with backtracking: place queens column by column, and at each row try every column, only proceeding if the position is not attac…
How Do You Search in a Rotated Sorted Array?
Searching a rotated sorted array for a target in O(log n) works by running a modified binary search: at each step, determine which half (left or right of mid)…
How Do You Find a Peak Element in an Array?
A peak element — one strictly greater than both its neighbors, with -infinity assumed beyond the array's edges — can be found in O(log n) using binary search:…
What is Binary Search on the Answer?
Binary search on the answer is a technique where, instead of searching for a value inside a sorted array, you binary search over the range of possible ANSWERS…
What is Ternary Search?
Ternary search finds the extremum (minimum or maximum) of a strictly unimodal function by evaluating the function at two interior points that split the range i…
What is Exponential Search?
Exponential search finds a target in a sorted array by first doubling an index (1, 2, 4, 8, ...) until it finds a range that must contain the target, then runn…
What is Interpolation Search?
Interpolation search finds a target in a sorted, uniformly distributed numeric array by estimating the target's likely position using linear interpolation of i…
What is Jump Search?
Jump search finds a target in a sorted array by jumping forward in fixed-size blocks of size √n until it finds a block that could contain the target, then doin…
How Would You Build Autocomplete Using a Trie?
You build autocomplete by inserting every candidate string into a trie character by character, then for a typed prefix you walk the trie to the node matching t…
What is a B+ Tree and Why Do Databases Use It?
A B+ tree is a self-balancing, multi-way search tree where all actual data (or record pointers) lives only in the leaf nodes, internal nodes hold only routing…