Foundations
Linear Structures
Hashing
Array and String Patterns
Recursion, Search, and Sorting
Problem Solving Patterns
Algorithm Searching
Sorting Algorithms
Array Algorithms
Grid Algorithms
Linear Structure Algorithms
Hashing Algorithms
Recursion and Backtracking
Greedy Algorithms
Tree and Heap Algorithms
Graph Algorithms
Dynamic Programming Algorithms
String Algorithms
Math Algorithms
Keyboard ready
Space plays. Arrow keys step. R restarts.
LAB Searching Basics Lab
Problem Solving
Concept shape
Core
0
1
2
3
4
5
Definition
Searching finds a target value or position in a collection.
Step 1 / 5
Concept shape
Problem Solving Core
Searching Basics
Welcome to the Searching Basics concept lab. Searching finds a target value or position in a collection. The must know points are: Linear search works anywhere. Binary search requires sorted or monotonic structure. Search can target an answer, not just an array value. The common operations are: scan, compare mid, move bounds. The complexity shape is Linear O(n), binary O(log n). Watch out for these pitfalls: Using binary search on unsorted data. Incorrect loop bounds. Related algorithms include Linear Search, Binary Search.
Concept details
Searching finds a target value or position in a collection.
Must know
- Linear search works anywhere.
- Binary search requires sorted or monotonic structure.
- Search can target an answer, not just an array value.
Complexity
Linear O(n), binary O(log n)
1.0x