# $k$-th Smallest Element in [[bst|BST]]
Utilize [[inorder]] traversal ([[dfs|DFS]]). Ideally using iteration.
```python
stack = []
while True:
while root:
stack.append(root)
root = root.left
root = stack.pop()
if not (k := k - 1):
return root.val
root = root.right
```