Data Structures Impact on Performance

Useful Extrasvaries

Data Structure Operation Complexity

StructureAccessSearchInsertDelete
ArrayO(1)O(n)O(n)O(n)
Linked ListO(n)O(n)O(1)*O(1)*
BST (balanced)O(log n)O(log n)O(log n)O(log n)
Hash TableN/AO(1) avgO(1) avgO(1) avg
Heap (min/max)O(1) minO(n)O(log n)O(log n)

* With pointer to the node. Without pointer, O(n) to find it first.