Re: [algogeeks] Inorder Iterative code for printing paths

2012-06-28 Thread Amitesh Singh
void printPath(node *p,node *child) { if( p child) std::cout Path: p-data =child-data std::endl; } use this before you assign 'current' to its children. e.g. printPath(p,p-left) or printPath(p,p-right); -- Amitesh On Mon, Jun 25, 2012 at 11:34 PM, Nishant

Re: [algogeeks] Inorder Iterative code for printing paths

2012-06-28 Thread Amitesh Singh
and to count no. of paths, you can do this void printPath(node *p,node *child) { static int iCountPath = 0; // or pass it as an argument non-const ref. if( p child) { ++iCountPath; std::cout Path: p-data =child-data std::endl; } } -- Amitesh On Thu, Jun 28,

Re: [algogeeks] Inorder Iterative code for printing paths

2012-06-28 Thread Nishant Pandey
thanx amitesh code is working fine .. i was displaying it in other way not like this , but yea it can be shown in this way too .. On Thu, Jun 28, 2012 at 1:08 PM, Amitesh Singh singh.amit...@gmail.comwrote: and to count no. of paths, you can do this void printPath(node *p,node *child) {

[algogeeks] Inorder Iterative code for printing paths

2012-06-25 Thread Nishant Pandey
thiss is iterative inorder code i am using for printing all the paths of the Btree . but i am not able to manipulate the lengths properly when its perform pop up so that i can print the paths properly .. Can any one help by modifying the changes in this code . void inorder(struct node *root)