4 Replies Latest reply on Oct 8, 2007 6:02 AM by 807600

    recursion problems

      So i have a little problem. Im writing a method that will go though a binary search tree and print out all the nodes in the tree in the pattern of an inorder traversal. What it is supposed to do is print out 3 things, the element in the node, its number in the inorder sequence, and the depth of that particular node. Everything works except the part where i need to print the inorder value of the node. How can i get a value to be printed out at the same time as the recursive call (like a counter) but without actually being part of the recursive call (which would lead to the counter going up or down depending on how many calls the method has gone through)? i would post my code but i do know that several people in my class look at this site frequently and i would rather not let them slack and use my work. If what i said was confusing post back and i will try to be more clear. thanks for the help!

      -hopefully_learning :P