MCPcopy Create free account
hub / github.com/careercup/ctci / BinaryTreeNode

Class BinaryTreeNode

python/Chapter 4/Question4_9/BinaryTreeNode.py:1–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class BinaryTreeNode:
2
3 def __init__(self, value):
4 self.value = value
5 self.left = None
6 self.right = None
7 self.parent = None
8
9 def setLeft(self, leftvalue):
10 leftnode = BinaryTreeNode(leftvalue)
11 self.left = leftnode
12 if leftnode != None:
13 leftnode.parent = self
14
15 def setRight(self, rightvalue):
16 rightnode = BinaryTreeNode(rightvalue)
17 self.right = rightnode
18 if rightnode != None:
19 rightnode.parent = self

Callers 3

mainFunction · 0.90
setLeftMethod · 0.70
setRightMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected