[algogeeks] LCA tutorial

2012-06-19 Thread Ankit Gupta
I was going through this tutorial http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor but i was not able to fully understand the O(N), O(1) algorithm for the restricted RMQ. They have converted the array into a new binary array and find a solution for this new

Re: [algogeeks] Re: Longest sequence of numbers with atmost diff K

2011-12-31 Thread ankit gupta
HNY 2012(IST) in between to all members and happy coding for 2012 may all your compilation produce ZERO errors On Sun, Jan 1, 2012 at 12:01 AM, Lucifer sourabhd2...@gmail.com wrote: @above Correction.. i can be = R... hence, which can be found as part of traversal.. Another addition: I

Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
apply MAXHEAPIFY on root ode and extract the root node -- 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

Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
maxheapify is lg(n)..check coremen -- 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

Re: [algogeeks] Re: Find Largest number in log(n)

2011-12-12 Thread ankit gupta
http://www.cse.iitk.ac.in/users/dsrkg/cs210/applets/sorting/heapSort/heapSort.html for reference -- 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,

Re: [algogeeks] Re: SAP!!

2011-10-01 Thread ankit gupta
DBMS questions.designing architecture stuffs using normalization etc..basic DS questions.DBMS is the most imp aspect prepare it well...good luck :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread ankit gupta
store inorder traversal in the array and while reconstructing form a tree around mid element using recursion... -- 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

[algogeeks] Re: Probability Puzzle

2011-08-14 Thread Ankit Gupta
A=p(biased coin/5 heads)=8/9 probability that the coin is biased given 5 heads (bayes theorem) B=p(unbiased coin/5 heads)=1/9 P(6th head)=A*1+B*1/2=17/18 -- 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: Microsoft Question!

2011-07-20 Thread Ankit Gupta
unsigned int reverse_bits (unsigned int n) { unsigned int m; m=0; while(n) { m*=2; if( n1 ) { m+=1; } n=1; } return m; } -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: Missing numbers

2009-07-30 Thread Ankit Gupta
take an array of n elements.Initially all zero.Traverse the given array and mark the corresponding no as 1. At last traverse again and entr which is zero still is out Answer. Time -O(n) Space O(n) Thanks Regards: Ankit Gupta Marie von Ebner-Eschenbachhttp://www.brainyquote.com/quotes/authors/m

[algogeeks] Re: puzzle any answers

2009-07-02 Thread Ankit Gupta
Yes Linda or Cindy either can be a winner.. Thanks Regards: Ankit Gupta B.Tech Final Year IT NIT,Allahabad Mob-+91-9369309343 On Thu, Jul 2, 2009 at 5:50 AM, liu yan ryu...@gmail.com wrote: Why Linda cannot be the Winner? Amy could be the second and Cindy is the third one. Thanks Liu Yan

[algogeeks] Re: puzzle any answers

2009-07-01 Thread Ankit Gupta
Cindy is Musician Thanks Regards: Ankit Gupta B.Tech Final Year IT NIT,Allahabad Mob-+91-9369309343 On Wed, Jul 1, 2009 at 1:14 PM, AKS abhijeet.k.s...@gmail.com wrote: Three beauty pageant finalists-Cindy, Amy and Linda-The winner was musician. The one who was not last or first was a math