Re: [algogeeks] Amazon Interview Question

2012-04-26 Thread bharat b
In input, he mentions #nodes and #edges of each nodes has, right? create an array of linked lists.. each index in the array represents the node number and the linked list of that represents edges of that node. Am I right? On Wed, Apr 25, 2012 at 5:40 PM, Radhakrishnan Venkataramani

[algogeeks] Algorithm internship question paper NSIT

2012-04-26 Thread deepikaanand
28 questions 120 min +1/-0.25 3 programming qs 1.to add two numbers stored in link list 2.to test is the given tree is a sumtree or not 3.to store numbers from a tree to a file and then retrieve those values and buld the tree Objective type qs 1. rec= fork(); rec= fork(); rec= fork(); rec=

Re: [algogeeks] Amazon Interview Question

2012-04-26 Thread Sukun Tarachandani
What will be the size of the array? You don't know the number of nodes in the graph. Implementing table doubling would be tedious. If they asked for a specific language implementation then for c++ you can use a vector of linked lists. Otherwise a linked list of pointers to head of linked lists