MCPcopy
hub / github.com/HuberTRoy/leetCode / prevPrint

Method prevPrint

Tree/BinarySearchTree.py:84–98  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

82 pass
83
84 def prevPrint(self):
85 # 根左右
86 nodes = [self.root]
87 result = []
88 while 1:
89 if not nodes:
90 return result
91 node = nodes.pop()
92 result.append(node.val)
93
94 if node.right:
95 nodes.append(node.right)
96
97 if node.left:
98 nodes.append(node.left)
99
100 def _middlePrint(self, root, result):
101 if root.left:

Callers

nothing calls this directly

Calls 1

popMethod · 0.45

Tested by

no test coverage detected