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)\) |
First In, First Out.
Last In, First Out.