[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

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

2012-02-25 Thread AMAN AGARWAL
??? 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 this group, send email to algogeeks@googlegroups.com. To unsubscribe

Re: [algogeeks] A binary tree question

2011-12-11 Thread AMAN AGARWAL
. 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 Algorithm Geeks group

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 atul.87fri...@gmail.comwrote: by zig-zag order means level order traversal ??? On Sun, Dec 11, 2011 at 6:22 AM, AMAN AGARWAL mnnit.a...@gmail.comwrote: Hi, Given a tree, in addition to the left and right pointer

[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 unsubscribe from this group

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
, Sayan On Sat, Dec 10, 2011 at 1:33 PM, AMAN AGARWAL mnnit.a...@gmail.comwrote: Hi, Construct a BST where each node has 3 pointers instead of 2. the structure is struct node { int data; struct node *left; struct node *right; struct node *inordersuccessor; } write a code to add nodes

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
= 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-succ = 22; and so on... On Sat, Dec 10, 2011 at 6:49 PM, AMAN AGARWAL mnnit.a...@gmail.comwrote: Hi Piyush, I tried with the following data

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 piyush4u.iit...@gmail.comwrote: yup, you are right.. On Sat, Dec 10, 2011 at 8:09 PM, AMAN AGARWAL mnnit.a...@gmail.comwrote: Hi, After 22 you

[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 because you

Re: [algogeeks] A bst problem

2011-12-10 Thread AMAN AGARWAL
of the current 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 mnnit.a...@gmail.comwrote: Hi. So can you please tell me the modifications required so it works correctly. Regards, Aman. On Sat

[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 Geeks group. To post

[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 group. To post to this group

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

2011-11-14 Thread AMAN AGARWAL
, On Mon, Nov 14, 2011 at 1:52 AM, AMAN AGARWAL mnnit.a...@gmail.comwrote: 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 same for the BST or binary tree

[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 subscribed

[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 counts

[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 subscribed

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

2011-08-03 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 Algorithm Geeks

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 nitin.nizha...@gmail.comwrote: nlogn ? On Wed, Aug 3, 2011 at 12:10 PM, AMAN AGARWAL mnnit.a...@gmail.comwrote: Hi, Convert a BST to max heap without using

[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 subscribed

[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 Algorithm Geeks group

[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 final

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

2011-08-01 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 Google Groups

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 rajeevr...@gmail.comwrote: Awesome Book ,for interviews : Covers wide range of interview questions . On Mon, Aug 1, 2011 at 12:23 PM, AMAN AGARWAL mnnit.a

[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 Algorithm Geeks group

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

2011-07-29 Thread AMAN AGARWAL
to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.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

[algogeeks] longest common string!!!!!

2011-07-29 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 counts! -- You

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

2011-07-29 Thread AMAN AGARWAL
...@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! -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

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

2011-07-29 Thread AMAN AGARWAL
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 Algorithm Geeks group. To post

[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 group, send email to algogeeks

Re: [algogeeks] Puzzle!!!!!

2011-07-28 Thread AMAN AGARWAL
://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 Algorithm Geeks group. To post to this group, send email to algogeeks

[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 Success

Re: [algogeeks] Puzzle!!!!!

2011-07-28 Thread AMAN AGARWAL
://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 Algorithm Geeks group. To post to this group, send email to algogeeks

[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 courage