Example #1
0
	def __str__(self):
		if self.root is None: return 'BinaryTree()'
		buff = 'BinaryTree('
		for x in node.traverse(self.root):
			buff += '%s, ' % x
		buff = buff.rstrip(', ')
		buff += ')'
		return buff
 def __str__(self):
     if self.root is None:
         return 'BinaryTree()'
     buff = 'BinaryTree('
     for x in node.traverse(self.root):
         buff += '%s ' % x
     buff = buff.rstrip(', ')
     buff += ')'
     return buff
 def traverse(self):
     for x in node.traverse(self.root):
         yield x
Example #4
0
	def traverse(self):
		for x in node.traverse(self.root):
			yield x