Data Structures & AlgorithmsVery hardICPC regional · geometry
Problem: What is the expected linear-time algorithm for the smallest enclosing circle of n points?
- A. Dijkstra's algorithm
- B. Floyd-Warshall
- C. Welzl's randomised incremental algorithm
- D. Prim's algorithm
Correct answer: C. Welzl's randomised incremental algorithm
Random insertion order makes the expected work linear, using the circle-through-points lemma.
More Coding Interview Problems questions
- Problem: Which data structure answers range-GCD queries with point updates in O(log n) each?
- Problem: What is the complexity of computing the n-th Fibonacci number modulo a prime p using matrix exponentiation?
- Problem: Which technique counts pairs in an array whose XOR is less than K in O(n bits) time?
- Problem: What is the time complexity of the Wagner-Fischer dynamic programme for edit distance on strings of length n and m?
- Problem: Which two properties define a matroid, which is what makes the greedy algorithm optimal?
- Problem: Which algorithm finds shortest paths in a grid where each cell weight is 0 or 1?