Data Structures Complexity Flashcards
Array Access
O(1)
Array Search
O(N)
Array Insertion
O(N)
Array Deletion
O(N)
Stack Access
O(N)
Stack Search
O(N)
Stack Insertion
O(1)
Stack Deletion
O((1)
Queue Access
O(N)
Queue Search
O(N)
Queue Insertion
O(1)
Queue Deletion
O(1)
Linked List Access
O(N)
Linked List Search
O(N)
Linked List Insertion
O(1)
Linked List Deletion
O(1)
Hash Table Access
O(1)
Hash Table Search
O(1)
Hash Table Insertion
O(1)
Hash Table Deletion
O(1)
Binary Search Tree Access
O(logN)
Binary Search Tree Search
O(logN)
Binary Search Tree Insertion
O(logN)
Binary Search Tree Deletion
O(logN)
Hash Table Search WORST Case
O(N)
If all items are at same address
Hash Table Insertion WORST Case
O(N)
Resizing
Hash Table Deletion WORST Case
O(N)
If all elements are at same address
Binary Search Tree Access WORST Case
O(N)
If unbalanced tree with all left or all right nodes
Binary Search Tree Search
WORST Case
O(N)
If unbalanced tree with all left or all right nodes
Binary Search Tree Insertion WORST Case
O(N)
If unbalanced tree with all left or all right nodes
Binary Search Tree Deletion WORST Case
O(N)
If unbalanced tree with all left or all right nodes