Skip to content

Commit 366bd1e

Browse files
committed
1 parent fa2ebe3 commit 366bd1e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: data_structures/binary_tree/kth_smallest_value_in_a_binary_search_tree.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def kthSmallest(root: Node, k: int) -> int:
2929
root = stack.pop()
3030
temp.append(root.data)
3131
root = root.right
32-
return temp[k-1]
32+
return temp[k - 1]
3333

34-
def main() -> None:
34+
if __name__ == "__main__":
3535
tree = Node(5)
3636
tree.left = Node(3)
3737
tree.right = Node(6)
@@ -40,6 +40,3 @@ def main() -> None:
4040
tree.left.left.left = Node(1)
4141
k = 2
4242
print(f"The {k}th Smallest Value in the BST is:", kthSmallest(tree, k))
43-
44-
if __name__ == "__main__":
45-
main()

0 commit comments

Comments
 (0)