Re: [algogeeks] Convert a Binary tree into spike.

2010-05-13 Thread Prashant K
use BFS traversal method -- Prashant Kulkarni || Lokaha Samastaha Sukhino Bhavanthu || || Sarve Jana Sukhino Bhavanthu || On Wed, May 12, 2010 at 8:48 PM, vinayan c vinayan1...@gmail.com wrote: Something like this 1 2 3 4

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-29 Thread Prashant K
@Umer Farooq but cycle can be between the nodes(not like circular list) so we may not get head node. @all i think mukesh answer is right On Mon, Mar 29, 2010 at 9:21 AM, Umer Farooq the.um...@gmail.com wrote: that's why i have a terminating condition. It will keep on iterating until ((N2 !=

Re: [algogeeks] First k smallest elements

2010-03-28 Thread Prashant K
hi, refer cormen book *Medians and Order Statistics* chapter . On Sat, Mar 27, 2010 at 11:14 PM, sharad kumar aryansmit3...@gmail.comwrote: i feel heapify the array to get a min heap and keep extracting root k times.any further optimisations??? On Sun, Mar 28, 2010 at 11:33 AM, Priyanka

Re: [algogeeks] parallel algorithm: find majority element

2009-12-09 Thread Prashant K
hi u can use Algorithm like CREW (parallel sorting algorithms) On Wed, Dec 9, 2009 at 1:22 PM, sankethm7 74.san...@gmail.com wrote: Hello folks, does anyone have idea to solve the problem given below: Assume that A[1…n] is an array a. Describe an efficient parallel algorithm that uses