Skip to content

Bst delete#11

Open
julienawilson wants to merge 13 commits into
masterfrom
bst-delete
Open

Bst delete#11
julienawilson wants to merge 13 commits into
masterfrom
bst-delete

Conversation

@julienawilson

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/bst.py
pre_order(self): Return a generator that returns each node value from pre-order traversal.
post_order(self): Return a generator that returns each node value from post_order traversal.
breadth_first(self): Return a generator returns each node value from breadth-first traversal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like a method is missing...

Comment thread README.md
* pre_order(self): Return a generator that returns each node value from pre-order traversal.
* post_order(self): Return a generator that returns each node value from post_order traversal.
* breadth_first(self): Return a generator returns each node value from breadth-first traversal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like a method is missing...

Comment thread src/test_bst.py
b_tree = BinarySearchTree()
b_tree.insert(17)
b_tree.insert(43)
import pdb; pdb.set_trace()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You probably shouldn't need this on github.

Comment thread src/bst.py
trav_list.enqueue(current_node.right)
yield current_node

def delete(self, value):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Delete breaks with empty tree. See assignment for how to handle this.

In [2]: bst = BinarySearchTree()

In [3]: bst.delete(1)
---------------------------------------------------------------------------
AttributeError: 'NoneType' object has no attribute 'value'

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