• edited by
844 views
1 1 vote

Given a set of $n$ points: $S=\left\{P_{1}, P_{2}, P_{3}, P_{4} \ldots P_{n}\right\}$, where $P_{1}=\left(x_{i}, y_{j}\right)$. Finding the pair of points that has the smallest distance among all pairs that can be solved in $O$ (nlogn) time using

  1. Divide and Conquer
  2. Greedy Technique
  3. Dynamic programming
  4. All of these

1 Answer

0 0 votes
using greedy approach we can solve in O(nlogn). ie. by using Kruskal's algo
Position:
Show:

Related questions

0 0 votes
2 2 answers
1.2k
1.2k views
rahul sharma 5 asked Dec 7, 2017
1,179 views
Consider the following code:Which of the following represents the number of additions performed by above code? main(){int d=0,i,j,k;for (i=1;i\leq20; ++i)for ( }j=1;j\l...
0 0 votes
2 answers 2 answers
894
894 views
mehul vaidya asked Aug 16, 2018
894 views
can you please explain how 1-(1/2)^ln(n) becomes (n-1)/n ? Answer will be $\Theta(n)$\[\begin{aligned}j & =n / 2+n / 4+n / 8+\ldots+1 \\& =n\left[1 / 2^{1}+1 / 2^{2}+1 /...
0 0 votes
1 1 answer
608
608 views
Arnabi asked Jan 28, 2017
608 views
3:17 AMVoLTE$42 \%$Solution ReportGATE Mock Test 1All QuestionQuestion: 15An element in an array $X$ is called leader if it is middle element in the sorted array. The bes...
0 0 votes
2 2 answers
785
785 views
junaid ahmad asked Dec 24, 2017
785 views
Let f (n) = Ο(n), g(n) = Ο(n) and h(n) = θ(n).Then [f (n) . g(n)] + h(n) is : a) Ο(n) b)θ(n)I think it must be 0(n)