Time Complexity of Data Structures

Data StructureSearchInsertionDeletionDelete MaxDelete Min
Array (unsorted)
Array (sorted)
Singly Linked List (Unsorted)
Singly Linked List (Sorted)
Doubly Linked List (Unsorted)
Doubly Linked List (Sorted)
Stack (LIFO)
Queue (FIFO)
Deque (Double-Ended Queue)
Hash Table
Binary Search Tree (BST)
AVL Tree
Red-Black Tree
B-Tree (order m)
B+ Tree (linked leaf nodes) (linked leaf nodes)
2-3-4 Tree
Binary Heap
Binomial Heap
Fibonacci Heap

Key Takeaways

  • Hash tables are fastest for search, insert, and delete, but have slow min/max operations.
  • Balanced trees (AVL, Red-Black, B-Trees) ensure performance for all operations.
  • Heaps are optimal for priority queues, providing efficient delete max/min.
  • B+ Trees are best for range queries, as they store all data in leaf nodes.
  • Binomial & Fibonacci Heaps are useful in graph algorithms (Dijkstra, Prim’s algorithm).