Data Structure


Common Operations Running Time

Search Select i-th statistic min/max rank successor (next element) output insert deletion
Sorted Array (static dataset) \(\mathcal{\theta}(\log n)\) \(\mathcal{O}(1)\) \(\mathcal{O}(1)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(1)\) \(\mathcal{O}(n)\)
Binary Search Tree (dynamic dataset) \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(n)\) \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\)
Heap \(\mathcal{O}(1)\) either min or max \(\mathcal{O}(\log n)\) \(\mathcal{O}(\log n)\)
Hash Table \(\mathcal{O}(1)\) \(\mathcal{O}(1)\) \(\mathcal{O}(1)\)

Queue

First In, First Out.

Stack

Last In, First Out.

Single linked List

Binary Search Tree

Notes

Min/Max Heap

Notes

Hash Table

References