[algogeeks] Re: Duplicate in an array

2010-10-20 Thread Asquare
@juver++ - could u plz elaborate.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more

[algogeeks] Re: Duplicate in an array

2010-10-20 Thread Asquare
@Anirvana - In context to the XOR method u suggested, could u plz explain why does it so happen.. ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this

[algogeeks] Re: linked lists

2010-10-20 Thread Asquare
@ligerdave - your algo will fail in the case the two arrays are: hellostl eeelexander ans : hellostlexander but according to ur method the answer would end up being hellostleeelexander -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Re: Maximum set of Collinear points

2010-10-15 Thread Asquare
@Dave - Got it..!! thanks :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more

[algogeeks] Re: Maximum set of Collinear points

2010-10-14 Thread Asquare
@ Mridul - even I had the same confusion.. Wht dave says is not this.. He is considering one point at a time (say A) and checking the maximum number of points (say n) which have the same slope with A... now wen he considers the next point (say B) and calculates slope with B for all other points

[algogeeks] Re: Maximum size binary search tree

2010-10-14 Thread Asquare
@ Shiv - ur method will fail for 22 / \ 47 7 / 35 /\ 17 45 \ 90 here 17 35 45 90 shd be the tree but in ur case as the first right is encountered (i.e. 45) the array would reset and not consider 90. -- You received this message because you are

[algogeeks] Re: plz explain output

2010-10-13 Thread Asquare
@Nidhi - I guess thats correct.. but am still not 100% sure about how the explanation goes.. Actually printf() is a variable argument function and so the acceptance of a value of a data type depends on the way it is defined in the library.. and since %f if encountered in the string must be

[algogeeks] Re: first unrepeated char

2010-10-13 Thread Asquare
Thanks :) This is definitely a much better option than O(mn) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: Maximum set of Collinear points

2010-10-13 Thread Asquare
@Dave - Although what u have posed is correct to an extent but this will also include cases where the line joining the points are parallel and not collinear So we will have to impose a check for one of the points involved in every two same slopes to be coincident. Do correct me if i am wrong..

[algogeeks] Re: missing 2 nums in an array

2010-10-12 Thread Asquare
Thanks everyone for putting in ur efforts.. @lingerdave - the array is not sorted.. @ Dave - although the equations will ultimately solve the problem but I guess it will get tedious and may also go out of bounds in case of the 4th power equation.. As for the other method of placing the number

[algogeeks] Re: missing 2 nums in an array

2010-10-12 Thread Asquare
@Dave - I have a doubt.. will we not incorporate the complexity we get for each while loop within the for loop..?? Basically complexity 2n right..?? another n because while loop runs for each misplaced number.. right?? which we take as O(n).. Have I understood it the right way?? -- You received

[algogeeks] first unrepeated char

2010-10-12 Thread Asquare
Given a string,find the first un-repeated character in it? Im getting O(n2) or O(mn) Anyone with a solution of lower complexity..?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: plz explain output

2010-10-11 Thread Asquare
This modified code also works in exactly the same way.. The explanation I had given earlier is correct.. and holds for this code as well -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] missing 2 nums in an array

2010-10-11 Thread Asquare
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers. I know of a solution using another array to store frequency of each number.. But this holds for than 2 nums also.. So Is there any other solution

[algogeeks] Re: DP

2010-10-10 Thread Asquare
Hi every1.. I have understood wht the question demands and also wht the 2D matrix u've used is doing but I haven't been able to get the logic u guys have used (@Gene, @Anand) Could you please explain the logic..?? thanks :) -- You received this message because you are subscribed to the Google

[algogeeks] Re: plz explain output

2010-10-10 Thread Asquare
As far as I have understood.. Its basically that once you give the input to t as float, that value is displayed for all the printf functions except one because of the %f modifier.. the %f modifier cannot accept x (int) as a successful argument so it takes the latest float value.. but in case of

[algogeeks] Re: Binary tree as threads and weights

2010-10-10 Thread Asquare
@Amit - could u explain this with an example?? Do u mean the root node after inverting will have all the nodes to one side?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To