Skip to content

Instantly share code, notes, and snippets.

View RadBoris's full-sized avatar

Rad Borislavov RadBoris

View GitHub Profile
@RadBoris
RadBoris / python_bst.py
Created April 21, 2016 02:13 — forked from bshyong/python_bst.py
Python BST implementation
class BSTnode(object):
"""
Representation of a node in a binary search tree.
Has a left child, right child, and key value, and stores its subtree size.
"""
def __init__(self, parent, t):
"""Create a new leaf with key t."""
self.key = t
self.parent = parent
self.left = None