Re: [algogeeks] Amazon interview question

2012-05-24 Thread Aman Raj
array of bits? if the current integer is present set the bit if else make it zero, searching, insertion and deletion all in O(1) time. On Thu, May 24, 2012 at 4:15 PM, rishabh shukla rockrishabh.mn...@gmail.com wrote: Suggest a data structure for storing million trillion numbers efficiently

[algogeeks] # of paths betweek two nodes in a DAG

2012-05-24 Thread Ashish Goel
My bad, i am not able to conceptualize this known problem, can anyone help Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

Re: [algogeeks] Amazon interview question

2012-05-24 Thread Ashish Goel
What is the purpose of these numbers, if the idea is to manage a free pool, then probably 10-ary-tree is the solution. May be Tiger Tree Hash a better answer where it is tree to say level 7 and then for rest three digits it become hash table. This way, the chunks can be kept on different machines

Re: [algogeeks] Amazon interview question

2012-05-24 Thread Ashish Goel
refer http://www.cs.bell-labs.com/cm/cs/pearls/sol01.html Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Thu, May 24, 2012 at 6:00 PM, Ashish Goel ashg...@gmail.com wrote: What is the purpose of these numbers, if the idea is to manage a free

Re: [algogeeks] classic problem to tree to circular doubly linked list

2012-05-24 Thread sanjay pandey
the main code is dis function only:i will explain dis static Node treeToList(Node root) { Node aList, bList; if (root==NULL) return(NULL);* /* the below next two lines are just lyk inorder traversal...u mst hv done dis*/* aList = treeToList(root-small); bList =

Re: [algogeeks] problem of fork()

2012-05-24 Thread Srikrishan Malik(gmail)
because the process which is executed from prompt has exited and the children are still alive and printing. On Thu, May 24, 2012 at 8:26 AM, Rajesh Kumar testalgori...@gmail.comwrote: #includestdio.h main() { fork(); fork(); fork(); printf(Hello Word\n); } output ---

Re: [algogeeks] problem of fork()

2012-05-24 Thread sumit mahamuni
its not about compilers ... its that new kernels kills all the child processes, if parent gets killed before.. so that is the reason you are gettin diff reasons On 5/24/12, himanshu kansal himanshukansal...@gmail.com wrote: i know that the program sholud have printed hello word 8 timesbt whn

Re: [algogeeks] Algorithm Question

2012-05-24 Thread sanjay pandey
min heap wid N elements containing first line from each file will do... remove the top most n insert next one from dat file only -- 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: Google Q : all anagrams next to each other

2012-05-24 Thread Anika Jain
I have a doubt. If u r doing inplace sorting of a word during checks for a word, wouldnt that change that word there itself? then how will the original anagram get restored to arrange in the output in sorted manner? On Thu, May 24, 2012 at 5:54 PM, Jitender Kumar jitender...@gmail.comwrote: The