Skip to content

Commit 51cff6a

Browse files
committed
Update README.md
1 parent dd7955f commit 51cff6a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

StandardTemplateLibrary/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# `StandardTemplateLibrary`
22

3+
## Data Structures
4+
5+
| Container | Implementation | Lookup | Insertion | Deletion |
6+
|-----------------------------|--------------------------------------------|--------------|----------------|--------------|
7+
| `std::list` | Doubly linked list | O(n) | O(1) (with iterator) | O(1) (with iterator) |
8+
| `std::forward_list` | Singly linked list | O(n) | O(1) (after node) | O(1) (after node) |
9+
| `std::vector` | Dynamic array (contiguous) | O(1) (random access) / O(n) (search) | O(1) amortized at end / O(n) elsewhere | O(n) |
10+
| `std::deque` | Double-ended queue (blocks) | O(1) (random access) | O(1) at front/back | O(1) at front/back |
11+
| `std::set`, `std::map` | Balanced binary tree (Red-Black tree) | O(log n) | O(log n) | O(log n) |
12+
| `std::unordered_set`, `std::unordered_map` | Hash table | O(1) average / O(n) worst | O(1) avg / O(n) worst | O(1) avg / O(n) worst |
13+
| `std::multiset`, `std::multimap` | Balanced binary tree (Red-Black tree) | O(log n) | O(log n) | O(log n) |
14+
| `std::unordered_multiset`, `std::unordered_multimap` | Hash table | O(1) average / O(n) worst | O(1) avg / O(n) worst | O(1) avg / O(n) worst |
15+
316
## **Quick Algorithm Lookup Table**
417

518
| What You Want to Know | On a Unsorted Range | On a Sorted Range | With a set or map | With a multiset or multimap |

0 commit comments

Comments
 (0)