Skip to content

Conversation

@chamberi
Copy link
Owner

Forked initially from Ted's repo, which he and I had worked on for 2 weeks.

"""
if self.root is None:
return 0
return self.calc_depth(self.root.right) - self.calc_depth(self.root.left)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-re-reverse this, as the specs want a left heavy tree to be positive


def search(self, val):
"""Return the node containing that value, else None."""
vertex = self.root
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vertex...it's different. Most people use current (curr).

a.insert(7)
a.insert(4)
assert a.contains(4)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider using fixtures to make your test code a little cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants