#=======================================================================
#
# Author: Isai Damier
# Title: BST Node
# Project: geekviewpoint
# Package: datastructure
#
# Description: A Binary Search Tree (BST) is a very simplified, well
# ordered graph. Now, all trees are simplified graphs. What makes
# the BST special is the degree to which it reduces the time
# complexity of fundamental operations like insert/add, delete/
# remove and search/find. With a BST, all these operations can
# be performed in O(log(n)) time. The basis for the speed of the
# BST is that for each node, the data in the left child is less
# and the data in the right child is greater than the data in
# said node.
#
# Here the nodes are given integer data instead of generics so to keep
# the logic of functions pertaining to the BST easy to follow.
#=======================================================================
class BST( object ):
def __init__( self ):
self.root = None
def getRoot( self ):
return self.root
class Node( object ):
data = None
left, right = None, None
def __init__( self, el ):
self.data = el