Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #260

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

test #260

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update bst.py
  • Loading branch information
monvin authored Oct 2, 2019
commit 5b5b7eaf31985ce5275bd44a538e705194f3d304
8 changes: 7 additions & 1 deletion graphs_trees/bst/bst.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#coding question using bst
#Binary Search Tree is a node-based binary tree data structure which has the following properties:
#The left subtree of a node contains only nodes with keys lesser than the node’s key.
#The right subtree of a node contains only nodes with keys greater than the node’s key.
#The left and right subtree each must also be a binary search tree.

class Node(object):

def __init__(self, data):
Expand Down Expand Up @@ -40,4 +46,4 @@ def _insert(self, node, data):
node.right.parent = node
return node.right
else:
return self._insert(node.right, data)
return self._insert(node.right, data)