Big O Cheat Sheet Flashcards
Analyze the complexity:
Array
Average
Access: Θ(1)
Search: Θ(n)
Insertion: Θ(n)
Deletion: Θ(n)
Space: O(n)
Analyze the complexity:
Array
Worst
Access: O(1)
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n)
Analyze the complexity:
Stack
Average
Access: Θ(n)
Search: Θ(n)
Insertion: Θ(1)
Deletion: Θ(1)
Space: O(n)
Analyze the complexity:
Stack
Worst
Access: O(n)
Search: O(n)
Insertion: O(1)
Deletion: O(1)
Space: O(n)
Analyze the complexity:
Queue
Average
Access: Θ(n)
Search: Θ(n)
Insertion: Θ(1)
Deletion: Θ(1)
Space: O(n)
Analyze the complexity:
Queue
Worst
Access: O(n)
Search: O(n)
Insertion: O(1)
Deletion: O(1)
Space: O(n)
Analyze the complexity:
Singly-Linked List
Average
Access: Θ(n)
Search: Θ(n)
Insertion: Θ(1)
Deletion: Θ(1)
Space: O(n)
Analyze the complexity:
Singly-Linked List
Worst
Access: O(n)
Search: O(n)
Insertion: O(1)
Deletion: O(1)
Space: O(n)
Analyze the complexity:
Doubly-Linked List
Average
Access: Θ(n)
Search: Θ(n)
Insertion: Θ(1)
Deletion: Θ(1)
Space: O(n)
Analyze the complexity:
Doubly-Linked List
Worst
Access: O(n)
Search: O(n)
Insertion: O(1)
Deletion: O(1)
Space: O(n)
Analyze the complexity:
Skip List
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n log(n))
Analyze the complexity:
Skip List
Worst
Access: O(n)
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n log(n))
Analyze the complexity:
Hash Table
Average
Access: N/A
Search: Θ(1)
Insertion: Θ(1)
Deletion: Θ(1)
Space: O(n)
Analyze the complexity:
Hash Table
Worst
Access: N/A
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n)
Analyze the complexity:
Binary Search Tree
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
Binary Search Tree
Worst
Access: O(n)
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n)
Analyze the complexity:
Cartesian Tree
Average
Access: N/A
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
Cartesian Tree
Worst
Access: N/A
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n)
Analyze the complexity:
B-Tree
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
B-Tree
Worst
Access: O(log(n))
Search: O(log(n))
Insertion: O(log(n))
Deletion: O(log(n))
Space: O(n)
Analyze the complexity:
Red-Black Tree
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
Red-Black Tree
Worst
Access: O(log(n))
Search: O(log(n))
Insertion: O(log(n))
Deletion: O(log(n))
Space: O(n)
Analyze the complexity:
Splay Tree
Average
Access: N/A
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
Splay Tree
Worst
Access: N/A
Search: O(log(n))
Insertion: O(log(n))
Deletion: O(log(n))
Space: O(n)
Analyze the complexity:
AVL Tree
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
AVL Tree
Worst
Access: O(log(n))
Search: O(log(n))
Insertion: O(log(n))
Deletion: O(log(n))
Space: O(n)
Analyze the complexity:
KD Tree
Average
Access: Θ(log(n))
Search: Θ(log(n))
Insertion: Θ(log(n))
Deletion: Θ(log(n))
Space: O(n)
Analyze the complexity:
KD Tree
Worst
Access: O(n)
Search: O(n)
Insertion: O(n)
Deletion: O(n)
Space: O(n)