Embercode
✕
Divide and ConquerQuick quiz

Closest pair in Python

6 questions. Covers Closest pair of points in Python.

Questions 1 to 5 of 6

  1. 1. In the strip step, the loop stops when strip[b].y - strip[a].y >= best. Why is it safe to stop there?
  2. 2. Take one point in the strip. At most how many points that come after it in y order can be within d of it?
  3. 3. What is the running time of checking every pair of n points, the brute force method used by brute_force in this lesson?
  4. 4. What is the running time of the divide and conquer closest pair method from this lesson?
  5. 5. True or false: solving the left half and the right half, then taking the smaller answer, always gives the closest pair. Give the reason for your answer.

5 question(s) left on this page.