Skip to content

Instantly share code, notes, and snippets.

@amckinley
Created July 17, 2017 17:26
Show Gist options
  • Save amckinley/5dc347c615bf4e51f85e393ed2da7279 to your computer and use it in GitHub Desktop.
Save amckinley/5dc347c615bf4e51f85e393ed2da7279 to your computer and use it in GitHub Desktop.
class Tree(object):
def __init__(self, root):
self.root = root
class Node(object):
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
def main():
tree = Tree(Node("i am root", left=Node("left child"), right=Node("right child")))
print tree.root.left.value
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment