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

Method setRight

python/Chapter 4/Question4_7/BinaryTreeNode.py:15–19  ·  view source on GitHub ↗
(self, rightvalue)

Source from the content-addressed store, hash-verified

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
20
21#-------------A solution------------
22class TreeNode:

Callers 1

mainFunction · 0.95

Calls 1

BinaryTreeNodeClass · 0.70

Tested by

no test coverage detected