I have a few comments on your code, though those might not increase performance by much:
1.
CODE
def getLeft(self):
if self.left != None:
return self.left
is actually the same as
CODE
def getLeft(self):
return self.left
When the interpreter doesnt run into a return statement in a function, it will return None. So your if statement doesnt do anything.
2.
You dont want to use getters and setters in Python that only get or set an attribute. Python is not Java(where getters and setters are (almost always) mandatory)

. Ryan Tomayko has written a
good article on this topic.
If this article isnt available anymore look up the "property" statement and google for "python getters setters" and "python getters are evil".
Because of 1 and 2 you dont need the getters of your TreeNode class.
3.
CODE
def __add__(self, node, dat):
...
Did you really want to overload the "+" Operator or did you want to write a private method?
For a private method the naming convention is to start with 2 underscores, but no underscores at the end.
Methods starting and ending with 2 underscores are meant for creators, destructors, operator overloading ...
So maybe you meant:
CODE
def __add(self, node, dat):
...
This post has been edited by Nallo: 20 Jul, 2009 - 07:14 AM