What is the time complexity of depth-first search on a graph stored as adjacency lists?
- AO(V × E)
- BO(E log V)
- CO(V + E)
- DO(V²)
What is the time complexity of depth-first search on a graph stored as adjacency lists?
Which sorting algorithm chooses a pivot and partitions the array into smaller and larger elements?
A problem is usually called tractable if:
Quicksort always uses the first element as pivot. On which input does it show its worst-case behaviour?
What is the time complexity of: for i = 1 to n: for j = 1 to i: do O(1) work?
What is the amortised time complexity of appending to a dynamic array that doubles its capacity when full?
For which knapsack variant does the greedy rule "take items in order of value per weight" always give an optimal answer?
What does the recurrence T(n) = 2T(n/2) + n log n solve to?
Full step-by-step solutions: practise this topic on examproblems.com.