General Tree - Lost!

Hello all

Trying to build a general tree for my class, but am feeling pretty lost about how to code it. Not a fan of any trees at the moment!

The basic pseudocode I want to follow is as such
1
2
3
  for each child
    dFP(child)
 print here


Here is some more information too...

1
2
3
4
5
6
void GenTree::depthFirstPrint(Node * here){
	//here is NULL or points to a Node in this GenTree
	//post:  has printed a list of the vals in the here subtree of this GenTree in depth-first order,
	//            all on the same line, separated by a single space

}


Help would really be appreciated!
Last edited on
Topic archived. No new replies allowed.