[algogeeks] whats the o/p of the code snippet

2012-02-25 Thread AMAN AGARWAL
fault. Can anybody explain me why??? Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to th

[algogeeks] difference b/w static global variables and global variables

2012-02-25 Thread AMAN AGARWAL
Hi , Is there any difference b/w static global variables and global variables ??? (apart from that static variables will be limited to that file only and global variables will be visible for other files also.) Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal:

Re: [algogeeks] A binary tree question

2011-12-11 Thread AMAN AGARWAL
Hi, Yes. Regards, Aman. On Sun, Dec 11, 2011 at 12:54 PM, atul anand wrote: > by zig-zag order means level order traversal ??? > > On Sun, Dec 11, 2011 at 6:22 AM, AMAN AGARWAL wrote: > >> Hi, >> >> Given a tree, in addition to the left and right pointer, it has a

Re: [algogeeks] A binary tree question

2011-12-11 Thread AMAN AGARWAL
> To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue th

[algogeeks]convert a sorted DLL to bst

2011-12-10 Thread AMAN AGARWAL
Hi, WAP to convert a sorted DLL to a balanced BST. Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" gr

[algogeeks] A binary tree question

2011-12-10 Thread AMAN AGARWAL
pointer alone, then we will be traversing the tree in the zig-zag order. Regards, Aman -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorithm G

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
nt node. > Here is the link: > > you can try out different cases also: > http://www.ideone.com/MOxdl > > -Piyush > > On Sat, Dec 10, 2011 at 8:28 PM, AMAN AGARWAL wrote: > >> Hi. >> >> So can you please tell me the modifications required so it works &

[algogeeks] A BST question

2011-12-10 Thread AMAN AGARWAL
Hi, Given a Binary tree where nodes may have positive or negative value, store the sum of the left and right subtree in the nodes. Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message b

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
Hi. So can you please tell me the modifications required so it works correctly. Regards, Aman. On Sat, Dec 10, 2011 at 8:22 PM, Piyush Grover wrote: > yup, you are right.. > > > On Sat, Dec 10, 2011 at 8:09 PM, AMAN AGARWAL wrote: > >> Hi, >> >> After 22 yo

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
> 18->left = 18->right = null; 18->succ = 15->succ = null; 15->right = > 15->succ = 18 > > add 22 (22 > 15) go to 15->right > (22 > 18) go to 18-> right > 22->left = 22->right = null; 22->succ = 18->succ = null; 18->right = > 18->suc

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
fatalerror("Out of space"); >>>> else >>>> { node->data=info; >>>> node->left=node->right=node->inordersuccessor=NULL; >>>> } >>>> } >>>> >>>> if (node->left==NULL

[algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- 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 u

Re: [algogeeks] LCA of a Binary tree not a binary search tree

2011-11-14 Thread AMAN AGARWAL
Mon, Nov 14, 2011 at 1:52 AM, AMAN AGARWAL wrote: > >> >> Hi, >> >> Please tell me the solution of this question. >> >> write a program which find LCA of a binary tree. It is not a BST >> > Does it matter its a BST or binary tree? the algo will be s

[algogeeks] LCA of a Binary tree not a binary search tree

2011-11-13 Thread AMAN AGARWAL
Hi, Please tell me the solution of this question. write a program which find LCA of a binary tree. It is not a BST Regards, Aman, -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are

[algogeeks] BST question

2011-11-10 Thread AMAN AGARWAL
Hi All, Please give me the solution of this problem. A binary tree and a number X is given. Find all the paths(not necessarily starting from root) such that the sum equals X. Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that c

[algogeeks] Re-entrant and thread safe

2011-10-29 Thread AMAN AGARWAL
Hi All, Please explain the difference between thread safe functions and re-entrant functions with example. Regards, Aman. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscri

[algogeeks] Data structure question!!!!

2011-08-03 Thread AMAN AGARWAL
Hi, Convert a min heap to BST without changing its structure and of course no extra space. Please post a code snippet also. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscri

Re: [algogeeks] Data structure question!!!!!!!

2011-08-03 Thread AMAN AGARWAL
Can you please suggest me your approch. Plaese give a code snippet for your approach. On Wed, Aug 3, 2011 at 12:13 PM, Nitin Nizhawan wrote: > nlogn ? > > On Wed, Aug 3, 2011 at 12:10 PM, AMAN AGARWAL wrote: > >> >> Hi, >> Convert a BST to max heap without using

[algogeeks] Data structure question!!!!!!!

2011-08-02 Thread AMAN AGARWAL
Hi, Convert a BST to max heap without using extra memory and in as optimum time as possible. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "

[algogeeks] sorting in O(n) time

2011-08-02 Thread AMAN AGARWAL
Hi, How can we sort one unsorted int array with O(n). Unsorted : {4,2,6,1,5,5,1,2,45,444,44,45,4,1} Sorted : {1,1,1,2,2,4,4,5,5,6,44,45,45,444} Is there any sorting method which gives us O(n) time complexity??? Please tell the algo if anybody knows it. -- AMAN AGARWAL "Success is not

[algogeeks] feedback of the book

2011-08-02 Thread AMAN AGARWAL
Hi, Please give me the feedback for the book Algorithms for interviews. by Adnan Aziz. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorit

Re: [algogeeks] Feedback of the book!!!!!!!

2011-08-01 Thread AMAN AGARWAL
Does it also contains the solutions of the questions??? Is it worth buying. ??? On Mon, Aug 1, 2011 at 12:36 PM, rajeev bharshetty wrote: > Awesome Book ,for interviews : Covers wide range of interview questions . > > On Mon, Aug 1, 2011 at 12:23 PM, AMAN AGARWAL wrote: > >&

[algogeeks] Feedback of the book!!!!!!!

2011-07-31 Thread AMAN AGARWAL
Hi, I am planning to buy a book cracking the coding interview by Gayle Laakmann. Please give your feedbacks. -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Goo

[algogeeks] Implementation of trie data structure

2011-07-30 Thread AMAN AGARWAL
Hi, Can somebody please give me code snippet for implementing trie data structure??? -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorit

Re: [algogeeks] Programming Puzzle!!!!!!!

2011-07-29 Thread AMAN AGARWAL
this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- Yo

Re: [algogeeks] Programming Puzzle!!!!!!!

2011-07-29 Thread AMAN AGARWAL
oups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to con

[algogeeks] longest common string!!!!!

2011-07-28 Thread AMAN AGARWAL
please give the solution for this problem... Give an algorithm to find the Longest common string of strings with lengths m,n respectively and also analyse their time complexities -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that c

Re: [algogeeks] Programming Puzzle!!!!!!!

2011-07-28 Thread AMAN AGARWAL
r more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorith

[algogeeks] binary search tree question!!!!

2011-07-28 Thread AMAN AGARWAL
Please tell the solution of this question Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can’t pass the value k to any function also -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the coura

Re: [algogeeks] Puzzle!!!!!

2011-07-28 Thread AMAN AGARWAL
ups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Group

[algogeeks] Programming Puzzle!!!!!!!

2011-07-28 Thread AMAN AGARWAL
Please tell me the solution of this puzzle.. You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called -- AMAN AGARWAL "Su

Re: [algogeeks] Puzzle!!!!!

2011-07-28 Thread AMAN AGARWAL
m. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups &qu

[algogeeks] Puzzle!!!!!

2011-07-28 Thread AMAN AGARWAL
5 10 7 should return 15 (sum of 3, 5 and 7) -- AMAN AGARWAL "Success is not final, Failure is not fatal: It is the courage to continue that counts!" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this