Awesome q2a theme
0 votes
14 views

Given an array, Find the 1st & 2nd largest element with min. no. of comparison??

answer is n-1 + logn – 1  = n + logn – 2

here tournament tree is used.Now I’m having doubt that after finding Largest element in (n-1) comparison, how can we find 2nd largest in (logn – 1) time???

anyone please explain.

closed with the note: Doubt cleared
in DS by (32 points)
closed by | 14 views
0
What is the source of this question ?
0
How can you close this question without replying?
0
Sir, actually my doubt was a silly doubt.

I realized that.( about t.c of finding 2 minimums by tournament tree)

That's why I closed it
0
I know you understood "how second minimum takes log n time only" by reading tifr question.

But my comment is what is the source of this question? You didn't reply for that even after seeing.
0
extremely sorry
0
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Oct 2019
  1. GAITONDE

    410 Points

  2. Satbir

    317 Points

  3. Rudr Pawan

    163 Points

  4. srestha

    132 Points

  5. Mk Utkarsh

    127 Points

  6. Debapaul

    94 Points

  7. chandrikabhuyan8

    83 Points

  8. Shaik Masthan

    79 Points

  9. Verma Ashish

    77 Points

  10. !KARAN

    74 Points

Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 450.
1,680 questions
1,088 answers
4,554 comments
89,591 users