Skip to content

Bst#1

Open
chamberi wants to merge 17 commits into
masterfrom
bst
Open

Bst#1
chamberi wants to merge 17 commits into
masterfrom
bst

Conversation

@chamberi
Copy link
Copy Markdown
Owner

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

Comment thread src/bst.py
"""
if self.root is None:
return 0
return self.calc_depth(self.root.right) - self.calc_depth(self.root.left)
Copy link
Copy Markdown

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

Comment thread src/bst.py

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

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).

Comment thread src/test_bst.py
a.insert(7)
a.insert(4)
assert a.contains(4)

Copy link
Copy Markdown

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.

3 participants