Big O Notation
Definition
A mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).
Code Example
Learn More
Related Terms
A linear data structure where each element (node) contains a value and a pointer to the next node. Unlike arrays, linked lists don't require contiguous memory and allow O(1) insertions at the head, but have O(n) random access.
Hash MapA data structure that maps keys to values using a hash function for O(1) average-case lookups, insertions, and deletions. In JavaScript, plain objects and the Map class serve as hash maps.
Binary SearchAn efficient O(log n) search algorithm that works on sorted arrays by repeatedly dividing the search interval in half. Compare the target to the middle element and eliminate half the remaining elements each step.