Data Structures & AlgorithmsVery hardICPC regional · randomised algorithms
Problem: What is the expected number of rounds of a randomised min-cut (Karger's algorithm) needed for a graph with n vertices to find a min cut with constant probability?
- A. Exactly one run
- B. 2^n runs
- C. n runs
- D. About n^2 log n runs
Correct answer: D. About n^2 log n runs
Each run finds a minimum cut with probability at least 2 / (n (n - 1)), so about n^2 log n runs boost the success probability.
More Coding Interview Problems questions
- Problem: What does the term 'amortised analysis' mean?
- Problem: What is the complexity of computing the number of inversions using a Fenwick tree over n distinct values?
- Problem: Which operation is the bottleneck of the naive recursive Fibonacci algorithm?
- Problem: What is the worst-case complexity of Heapsort on n elements?
- Problem: What is the property of a 'Monge' matrix that enables fast DP optimisation?
- Problem: Which problem is classically solved by the 'convex hull trick' in DP with linear functions?