Re: [algogeeks] Re: Microsoft interview question

2012-05-20 Thread anuj agarwal
U are checking if the sum is same or not.. which can be same even if the elements are different. On Sun, May 20, 2012 at 11:54 AM, Piyush Khandelwal piyushkhandelwal...@gmail.com wrote: Hiii!! I have some idea about the solution. Please notify me if i am wrong a= [ 4,3,5 ] and b= [

Re: [algogeeks] c output

2011-06-01 Thread anuj agarwal
This will be same as: b=b+1; b=b+1; a=b*b; Basically, all prefix increment and decrement operators will be executed first. Similarly all postfix operators will be executed at last. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Wed, Jun 1, 2011 at 5:27

[algogeeks] Admin of Group

2011-05-25 Thread anuj agarwal
of SPAMS. I guess no body wants to get a job from this group (specially ones which are sent by some Panzer). If the mods are reading this, Please take some action on that mails so that group will remain clean. Sorry for off topic. Anuj Agarwal Engineering is the art of making what you want from things

Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread anuj agarwal
Immanuel, We can keep c and n arrays as global variable as they are not part of state of the recursion. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Mon, May 23, 2011 at 10:04 PM, immanuel kingston kingston.imman...@gmail.com wrote: small correction

Re: [algogeeks] Re: PUZZLE

2011-05-20 Thread anuj agarwal
@Dave: The problem statement says, the elephant can take 1000 at a time. If he take max 1000, and eat 1 banana in each 1 km travel, he will be having 0 after 1000 Km. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Sat, May 21, 2011 at 9:57 AM, Dave

Re: [algogeeks] Re: sum of two

2011-05-20 Thread anuj agarwal
@Dave: He is talking of a better hash function. You did not mention the hash function which you will use. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Sat, May 21, 2011 at 9:59 AM, Dave dave_and_da...@juno.com wrote: @Apoorve: See my response

Re: [algogeeks] Re: GOOGLE Q

2011-05-17 Thread anuj agarwal
Same method as Gene told. Only enhancement u can made is start from the word nearer to sorted string and compare till the nearest word of the reverse of sorted string. You don't need to check the whole dictionary. Anuj Agarwal Engineering is the art of making what you want from things you can

Re: [algogeeks] Array problem

2011-05-16 Thread anuj agarwal
How about create a BST and then, for each node find the difference between the node and its child and do this for all except leaf nodes. If u want i will write the code for the same. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Mon, May 16, 2011 at 11

Re: [algogeeks] Array problem

2011-05-16 Thread anuj agarwal
Kunal, Your solution runs in O(n) time but it is a wrong solution. It will run fine if the array is sorted. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Mon, May 16, 2011 at 7:17 PM, Kunal Patil kp101...@gmail.com wrote: @Piyush Sinha: I doubt

Re: [algogeeks] Print Subsets

2011-05-16 Thread anuj agarwal
Correct. Its a variant of Knapsack problem. Anuj Agarwal Engineering is the art of making what you want from things you can get. On Mon, May 16, 2011 at 4:53 PM, anshu mishra anshumishra6...@gmail.comwrote: its DP problem can be solved in O(m*n) where m is number of elements in array and n