how to traverse a tree

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ericstein81
    New Member
    • Jul 2007
    • 14

    how to traverse a tree

    I need to traverse a binary search tree and be able to give an output of how many leaf nodes there are, and how many leafs have one child and how many leafs have two children. Im not asking for a code just the general idea of how to process the information. Thank you
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Well, how could you possibly do this?

    One thing I remember about working with trees is that most of this type of work was done with recursion. Have you worked with recursive functions before? If so, this should be easy!

    Comment

    Working...