Data Structures: Linear, Trees Hash-Based
When to Use
| Need | Structure | |------|-----------| | O(1) insert/delete at head | Singly linked list | | O(1) insert/delete at both ends | Doubly linked list | | LIFO (undo, DFS, bracket matching) | Stack | | FIFO (BFS, print queue, sliding window) | Queue / deque | | O(1) amortized append, random access | Dynamic array | | Sorted order, range queries | BST / AVL | | Many writes + sorted order | Red-Black tree | | O(1) avg lookup/insert/delete
[Description truncada. Veja o README completo no GitHub.]