@sangeeta: n-1 comparison required to choose winner. By tournament approach
winner has played match with logn team and winner must have beaten second
largest element. So among logn number we can select maximum in logn - 1
comparison.

So total comparison required is: n + logn -2

On Thu, Aug 30, 2012 at 10:23 PM, sangeeta goyal <sangeeta15...@gmail.com>wrote:

> @Don can you give the algorithm for the same??
> how would you implement it??
>
>
> On Thu, Aug 30, 2012 at 10:03 PM, Don <dondod...@gmail.com> wrote:
>
>> The second largest element is the largest element beaten by the
>> winner.
>> So if you implement a tournament in which each element keeps track of
>> the largest element it has beaten, you'll get the second largest
>> naturally.
>> Don
>>
>> On Aug 29, 9:15 am, Sangeeta <sangeeta15...@gmail.com> wrote:
>> > give the algo or program to find second largest element in a list using
>> > tournament method
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to