Operation | Time or Space | Efficiency |
---|---|---|
Search an unsorted array of size n for a specific key | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Search an unsorted array of size n for a specific key | Time | O(n) |
Operation | Time or Space | Efficiency |
---|---|---|
Binary search a sorted array of size n for a specific key | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Binary search a sorted array of size n for a specific key | Time | O(log n) |
Operation | Time or Space | Efficiency |
---|---|---|
Sort an array of size n using insertion sort or bubble sort | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Sort an array of size n using insertion sort or bubble sort | Time | O(n2) |
Operation | Time or Space | Efficiency |
---|---|---|
Sort an array of size n using quick sort or merge sort | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Sort an array of size n using quick sort or merge sort | Time | O(n log n) |
Operation | Time or Space | Efficiency |
---|---|---|
Search a balanced binary search tree of n elements for a specific key | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Search a balanced binary search tree of n elements for a specific key | Time | O(log n) |
Operation | Time or Space | Efficiency |
---|---|---|
Search an unbalanced binary search tree of n elements for a specific key | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Search an unbalanced binary search tree of n elements for a specific key | Time | O(n) |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Time | O(V+E) |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Space |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Space | O(ad) |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Time | O(V+E) |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Space |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a graph with V vertices, E edges, average adjacency list size a, and search depth d | Space | O(a × d) |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a state space search tree with branching factor b, and search depth d | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a state space search tree with branching factor b, and search depth d | Time | O(bd) |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a state space search tree with branching factor b, and search depth d | Space |
Operation | Time or Space | Efficiency |
---|---|---|
Breadth-first search of a state space search tree with branching factor b, and search depth d | Space | O(bd) |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a state space search tree with branching factor b, and search depth d | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a state space search tree with branching factor b, and search depth d | Time | O(bd) |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a state space search tree with branching factor b, and search depth d | Space |
Operation | Time or Space | Efficiency |
---|---|---|
Depth-first search of a state space search tree with branching factor b, and search depth d | Space | O(b × d) |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to or removing from a linear array implementation of a priority queue of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to or removing from a linear array implementation of a priority queue of n elements | Time | O(n) |
Operation | Time or Space | Efficiency |
---|---|---|
Removing from a linked list implementation of a priority queue of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Removing from a linked list implementation of a priority queue of n elements | Time | O(1) |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to a linked list implementation of a priority queue of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to a linked list implementation of a priority queue of n elements | Time | O(n) |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to or removing from a binary heap implementation of a priority queue of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Adding to or removing from a binary heap implementation of a priority queue of n elements | Time | O(log n) |
Operation | Time or Space | Efficiency |
---|---|---|
Inserting into a hash table of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Inserting into a hash table of n elements | Time | O(1) |
Operation | Time or Space | Efficiency |
---|---|---|
Deleting from a hash table of n elements | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Deleting from a hash table of n elements | Time | O(1) |
Operation | Time or Space | Efficiency |
---|---|---|
Searching for a key in a hash table of n elements (worst case) | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Searching for a key in a hash table of n elements (worst case) | Time | O(n) |
Operation | Time or Space | Efficiency |
---|---|---|
Searching for a key in a hash table of n elements (average case) | Time |
Operation | Time or Space | Efficiency |
---|---|---|
Searching for a key in a hash table of n elements (average case) | Time | O(1) |