Re: Binary tree problem (searching)

2006-04-04 Thread [EMAIL PROTECTED]
This took a moment I spent a lot of time stupidly thinking about right/left sorting, is it looping? no that's not it...doh Then the light then realized this if self.key == key: return 1 elif key < self.key: if self.left: self.left.find(key

Re: Binary tree problem (searching)

2006-04-04 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi all, > > I am running into a conceptual glitch in implementing a simple binary tree > class. My insertion and printing (sorting) seems to be ok, but when I search > the tree, my find method isn't doing what I thought it should. > > Here is the output of running

Binary tree problem (searching)

2006-04-04 Thread pyguy
Hi all, I am running into a conceptual glitch in implementing a simple binary tree class. My insertion and printing (sorting) seems to be ok, but when I search the tree, my find method isn't doing what I thought it should. Here is the output of running my tests: >python -i trees.py ***