 Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++
Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++ 
  
  
  
  
 
 show the order in which the nodes are visited during
	the following tree traversals:
	show the order in which the nodes are visited during
	the following tree traversals:
	
 .
. is a recursive function.
	Write a non-recursive depth-first traversal routine
	that has exactly the same effect as the recursive version.
 is a recursive function.
	Write a non-recursive depth-first traversal routine
	that has exactly the same effect as the recursive version. defines a visitor that prints
	using infix notation
	the expression represented by an expression tree.
	Write a visitor that prints the same expression
	in prefix notation with the following format:
 defines a visitor that prints
	using infix notation
	the expression represented by an expression tree.
	Write a visitor that prints the same expression
	in prefix notation with the following format:
	 
 ,
	but this time write a visitor that the expression
	in postfix notation with the following format:
,
	but this time write a visitor that the expression
	in postfix notation with the following format:
	 
 prints many redundant parentheses because it does
	not take into consideration the precedence of the operators.
	Rewrite the visitor so that it prints
	prints many redundant parentheses because it does
	not take into consideration the precedence of the operators.
	Rewrite the visitor so that it prints
	 
rather than
 
 .
. so that it applies to N-ary trees.
 so that it applies to N-ary trees. and
 and   and
	the relation
 and
	the relation   given by
 given by
	 
	If   ,
	the trees are said to be isomorphic .
	Devise an algorithm to test whether two binary trees are isomorphic.
	What is the running time of your algorithm?
,
	the trees are said to be isomorphic .
	Devise an algorithm to test whether two binary trees are isomorphic.
	What is the running time of your algorithm?
 
  
  
  
  
 
 Copyright © 1997 by Bruno R. Preiss, P.Eng.  All rights reserved.
Copyright © 1997 by Bruno R. Preiss, P.Eng.  All rights reserved.