Array
Numbered slots side by side, so reaching any one of them costs the same.
Cost
- Access
- O(1)
- Search
- O(n)
- Insert
- O(n)
- Delete
- O(n)
- Space
- O(n)
Insert and delete at the end are O(1) when capacity allows.
Leads to
Topics that need this one first.
- Adjacency List
- Binary Heap
- Dynamic Array
- Hash Table
- Queue
- Singly Linked List
- Stack
- String
- Circular Queue
- Disjoint Set Union
- Edge List
- Fenwick Tree
- Matrix
- Segment Tree
- Bitset
- Array Delete
- Array Insert
- Array Search
- Array Traversal
- Prefix Sum
- Reverse Array
- Binary Search
- Linear Search
- Bubble Sort
- Insertion Sort
- Merge Sort
- Selection Sort
- Sliding Window
- Two Pointers
- Range Minimum Query
- Sieve of Eratosthenes
Taught by the same lesson
Array covers these too, in the same run.