[algogeeks] amazon Interview

2012-08-26 Thread Ravi Ranjan
You are given many slabs each with a length and a breadth. A slab i can be put on slab j if both dimensions of i are less than that of j. In this similar manner, you can keep on putting slabs on each other. Find the maximum stack possible which you can create out of the given slabs and for

Re: [algogeeks] Amazon Q

2012-08-26 Thread Navin Kumar
Q1 Solution: . we can use doubly linked list with hash to implement all the operation in O(1). By keeping track of head and tail pointer we can do enqueue and dequeue in O(1) time. In hash we will keep track of each element present in linked list(queue). With node value as a hash key and address

Re: [algogeeks] amazon Interview

2012-08-26 Thread atul anand
its a LIS problem. need to think for n-dimension... On 8/26/12, Ravi Ranjan ravi.cool2...@gmail.com wrote: You are given many slabs each with a length and a breadth. A slab i can be put on slab j if both dimensions of i are less than that of j. In this similar manner, you can keep on putting

[algogeeks] CISCO Written Test ??

2012-08-26 Thread swami nathan
Hi all, Whether anyone appeared for CISCO this year? If so pls provide me the *written test pattern* as well as the interview process. Thanks in advance!! -- Regards, Swaminathan M -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] Gate complaxity question

2012-08-26 Thread GAURAV CHAWLA
see A(n)ie the average case will always be smaller or equal to the worst case... ie something like... A(n)= c. w(n) for some c as constt ... which the definition of big O... correct me if i'm wrong.. On Sat, Aug 25, 2012 at 7:11 PM, rahul sharma rahul23111...@gmail.comwrote: *Let

[algogeeks] ATRENTA PAPERS

2012-08-26 Thread lomash goyal
Atrenta is visiting our campus on tuesday.Can anyone please mail me the placement papers of atrenta.. Thanks in acknowledgement... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] amazon Interview

2012-08-26 Thread Kailash Bagaria
Yeah Atul is right. Here is my solution:-- 1) first rearrange the dimensions of slabs i.e. put bigger dimension in y and smaller dimenson in x (rotate the slab) 2) then arrange all slabs in increasing order of x dimension 3) and then find the longest increasing sub-sequence based on y

[algogeeks] max sum b/w 2 leaf nodes in a binary tree

2012-08-26 Thread kunal rustgi
Hi, Can anyone suggest the best approach for finding max sum b/w 2 leaf nodes in a binary tree ( not BST ) ? -- 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

Re: [algogeeks] max sum b/w 2 leaf nodes in a binary tree

2012-08-26 Thread atul anand
its the diameter of tree. you can find implementation on geeksforgeeks On 8/25/12, kunal rustgi rustogi.ku...@gmail.com wrote: Hi, Can anyone suggest the best approach for finding max sum b/w 2 leaf nodes in a binary tree ( not BST ) ? -- You received this message because you are

Re: [algogeeks] amazon Interview

2012-08-26 Thread atul anand
@kailash : you can simply find area of each slab area=x*y ,,,store it; then just run LIS on this area. On 8/26/12, Kailash Bagaria kbkailashbaga...@gmail.com wrote: Yeah Atul is right. Here is my solution:-- 1) first rearrange the dimensions of slabs i.e. put bigger dimension in y and

Re: [algogeeks] amazon Interview

2012-08-26 Thread Dave
@Atul007: No, because a (1,4) tile will not fit on a (2,3) tile. Dave On Sunday, August 26, 2012 7:45:27 AM UTC-5, atul007 wrote: @kailash : you can simply find area of each slab area=x*y ,,,store it; then just run LIS on this area. On 8/26/12, Kailash Bagaria kbkailas...@gmail.com

Re: [algogeeks] amazon Interview

2012-08-26 Thread atul anand
@dave : correct.. i guess this will work :- sort in decreasing area. then run LIS such that for i j , length( i ) length( j ) width( i ) width( j ) On 8/26/12, Dave dave_and_da...@juno.com wrote: @Atul007: No, because a (1,4) tile will not fit on a (2,3) tile. Dave On Sunday, August

Re: [algogeeks] Amazon Q

2012-08-26 Thread Mind Boggler
Q2) get to n/2 nodes Reverse link list after n/2 nodes Now check from 1st node and n/2 node for equality Can make the checking for equality function recursive Sent from my iPhone 4 On 26-Aug-2012, at 12:41 AM, Ashish Goel ashg...@gmail.com wrote: Q1. Design a data structure for the following

Re: [algogeeks] Gate complaxity question

2012-08-26 Thread rahul sharma
@ll...thnx a lot On Sat, Aug 25, 2012 at 8:22 PM, GAURAV CHAWLA togauravcha...@gmail.comwrote: see A(n)ie the average case will always be smaller or equal to the worst case... ie something like... A(n)= c. w(n) for some c as constt ... which the definition of big O... correct

[algogeeks] Re: CISCO Written Test ??

2012-08-26 Thread deepikaanand
written test will be (apti + tech) no negative marking apti from time , speed and distance, probablity , mixtures , profit and loss (easy) 2 qs to infer from the passage given(critical reasoning) 1 DI set (too simple) and technical qs 2 simple C o/p qs A large %age of qs was from digital logic

Re: [algogeeks] Re: Printing random word from file

2012-08-26 Thread Kunal Patil
Okay..missed it..thnx fr info.. Your approach is nice..it took me some time to understand your code's though.. Great answer!! On Aug 26, 2012 3:55 AM, Dave dave_and_da...@juno.com wrote: @Kunal: Yes. You are missing that you don't know the number of words in the file in advance. So, to use your

[algogeeks] Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-26 Thread Ankit Singh
In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom nk]denotes the number of ways of choosing k objects from n different objects. However when n and k are too large, we often save them after modulo

Re: [algogeeks] Re: Printing random word from file

2012-08-26 Thread Kailash Bagaria
@Dave: Can you throw some light on random() function?? How it is generating numbers between 0.0 and 1.0, and how many digits are there after the point...because if there is only one digit then we will not be able to print words after 10th place because 10*0.1(lowest number generated by

[algogeeks] Re: Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-26 Thread Dave
@Ankit: Apply Lucas' Theorem, which you can find written up in Wikipedia. Dave On Sunday, August 26, 2012 3:57:18 PM UTC-5, Ankit Singh wrote: In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom

Re: [algogeeks] Re: CISCO Written Test ??

2012-08-26 Thread apoorv gupta
Der were many questions from electronics part also..20 apti 20 electronic ques 10 c/netwrking ques..So computer science people will have a tough luck.So revise basics of electronics. ques like half wave rectifier efficiency were asked On Sun, Aug 26, 2012 at 10:24 PM, deepikaanand

Re: [algogeeks] amazon Interview

2012-08-26 Thread atul anand
but how to solve this problem for with n-dimension ?? On Sun, Aug 26, 2012 at 6:47 PM, atul anand atul.87fri...@gmail.com wrote: @dave : correct.. i guess this will work :- sort in decreasing area. then run LIS such that for i j , length( i ) length( j ) width( i ) width( j ) On