Пример #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
Пример #2
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
Пример #3
0
 def traverse(self):
     for x in node.traverse(self.root):
         yield x
Пример #4
0
	def traverse(self):
		for x in node.traverse(self.root):
			yield x