"""
Copyright 2018, University of Freiburg
Philipp Bamberger
"""
class TreeElement:
'''
Represents a node of a binary search tree
(no data object required for this exercise)
'''
def __init__(self, key):
self.key = key
self.parent = None
self.left = None
self.right = None
class BinarySearchTree:
'''
Represents a binary search tree via its root
'''
def __init__(self):
self.root = None
def insert(self, key):
'''
Insert key into the binary search tree
Args:
key - key to be inserted
'''
def find(self, key):
'''
Find key in the binary search tree
Args:
key - key to search for
Returns:
TreeElement with key if present and None else
'''
def delete(self, key):
'''
Delete node with key from the search tree if present
Args:
key - key to be deleted
'''