View Single Post
Old Apr 6th, 2006, 11:21 PM   #14
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 884
Rep Power: 4 The Dark is on a distinguished road
You have a special case for the root node already in your code.
    else if(counter == 1)
      {
        delete root;
	      root = NULL;
      }
    else
Why not just print it there before you delete it?

In the other case, where there is more than just the root node, print the root node before you find and delete the last node.
The Dark is online now   Reply With Quote