Data Structures & AlgorithmsModerateProduct Company SDE · sweep line
Problem: Which technique gives the answer to 'minimum number of platforms' by sorting events?
- A. Sweep line over sorted arrival and departure times
- B. Dijkstra's algorithm
- C. Gale-Shapley
- D. Prim's algorithm
Correct answer: A. Sweep line over sorted arrival and departure times
Sorting events and scanning with a counter gives the peak overlap as the answer.
More Coding Interview Problems questions
- Problem: Which of these is the standard O(n log n) algorithm for the longest increasing subsequence?
- Problem: What is the standard complexity of computing all pairs of shortest paths in a graph with V vertices using repeated squaring of…
- Problem: Which result says that every planar graph is 5-colourable?
- Problem: What is the purpose of the 'lowest common multiple of the array' technique in competitive programming?
- Problem: In counting sort, what limits its use on a large input?
- Problem: What does the expression 'x & (x - 1)' clear in the binary representation of x?