[algogeeks] google questions

2011-01-31 Thread snehal jain
1. how do u find 10 most repeating words on a large file containing words in most efficient way 2. Given a text file, implement a solution to find out if a pattern similar to wild cards can be detected. fort example find if a*b*cd*, or *win or *def* exists in the text. -- You received this

Re: [algogeeks] Google questions

2010-12-13 Thread Akash Agrawal
It is like finding the in order successor. See it here (using parent pointer) http://tech-queries.blogspot.com/2010/04/inorder-succesor-in-binary-tree.html w/0 Parent pointer: http://tech-queries.blogspot.com/2010/04/inorder-succesor-in-binary-tree-wo.html Regards, Akash Agrawal

Re: [algogeeks] Google questions

2010-12-09 Thread rajan goswami
1. Below is a solution of first problem - int SuccessorOfANodeInBST(Node N, int givenNumber) { if(N-rightChild != NULL) return (int) N-rightchild-data; int iNumberFound = 0; Node K = ParentOf(N); Node J = ParentOf(K); while(1) { if(K == J-leftChild) {

Re: [algogeeks] Google questions

2010-12-09 Thread Shuaib
On 09-Dec-2010, at 1:28 PM, rajan goswami wrote: 1. Below is a solution of first problem - int SuccessorOfANodeInBST(Node N, int givenNumber) { if(N-rightChild != NULL) return (int) N-rightchild-data; Why this? The right child might not be the next immediate higher

Re: [algogeeks] Google questions

2010-12-09 Thread GOBIND KUMAR
Code for question no.--2 #includestdio.h #includeconio.h #includetime.h struct test{ clock_t endwait; void (*print_ptr)(); }; void print() {printf(\nHello World\n);} void wait ( int seconds ) { struct test *g=(struct test *)malloc(sizeof(struct test)); g-endwait= clock

Re: [algogeeks] Google questions

2010-12-08 Thread sahil gujral
explain the 1st one again On Thu, Dec 9, 2010 at 11:16 AM, Anand anandut2...@gmail.com wrote: One of my friend recently had a telephonic interview and he got two question to program. 1. Given a binary search tree. Write a function which takes any given node from the binary tree and a