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 http://tech-queries.blogspot.com/
On Thu, Dec 9, 2010 at 11:33 PM, GOBIND KUMAR <[email protected]> wrote: > Code for question no.--2 > > > #include<stdio.h> > #include<conio.h> > #include<time.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 () + seconds * CLOCKS_PER_SEC ; > while (clock() < g->endwait) {} > (g->print_ptr)=print; > (*(g->print_ptr))(); > > } > int main(){ > int sec; > printf("Enter the time after which you want output:"); > scanf("%d",&sec); > wait(sec); > getch(); > return; > } > > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
