Re: [algogeeks] finding element in array with minimum of comparing

2012-10-12 Thread Mangal Dev Gupta
Yup, Sry for the mistake... Should have analysed it On Wed, Oct 10, 2012 at 12:59 AM, Dave dave_and_da...@juno.com wrote: @Phoenix: If elem does not exist in the array and we did not put it in the array, then the loop would exceed the array. But by setting arr[0] to elem, we ensure that

Re: [algogeeks] Re: give the algo or program to find second largest element in a list using tournament method

2012-10-12 Thread sangeeta goyal
can anybody tell why this code is not giving correct output for finding second smallest using tournament method? my approach is same as @Don approach On Wed, Sep 5, 2012 at 12:16 PM, shashi kant shashiski...@gmail.com wrote: Heap's good but the i think problem clearly mentions Tournament sort