Skip to content

Latest commit

 

History

History
executable file
·
14 lines (7 loc) · 373 Bytes

230.md

File metadata and controls

executable file
·
14 lines (7 loc) · 373 Bytes

230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.

Interesting! left root right is the order of

Transfer the BST to array first?

STD use a count to count the number of nodes we traverse!

L L L L L ROOT RIGHT LEFT LEFT LEFT ROOT RIGHT => keep the inorder!

This method is so clever!