Data Structures & AlgorithmsHardICPC regional · geometry
Problem: Which algorithm finds the convex hull of n points in O(n log n) by sorting and building lower and upper chains?
- A. Kruskal's algorithm
- B. Andrew's monotone chain
- C. Gale-Shapley
- D. Tarjan's SCC
Correct answer: B. Andrew's monotone chain
Sorting points by x and scanning with a stack builds the hull in O(n log n) total.
More Coding Interview Problems questions
- Problem: What is the expected linear-time algorithm for the smallest enclosing circle of n points?
- 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?