MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / find_data

Method find_data

Tree/KthSmallestElementInABST.py:61–68  ·  view source on GitHub ↗
(self, root: TreeNode)

Source from the content-addressed store, hash-verified

59class Solution:
60
61 def find_data(self, root: TreeNode):
62
63 if root is None:
64 return
65 Solution.find_data(self,root.left)
66 self.data.append(root.val)
67 Solution.find_data(self,root.right)
68 return
69
70 def kthSmallest(self, root: TreeNode, k: int) -> int:
71 self.data = []

Callers 1

kthSmallestMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected