Skip to content

[BST] Kth Smallest Element in a BST #120

@sudosf

Description

@sudosf

Problem

Given the root of a BST and an integer k, return the kth smallest value among all node values.

References

Difficulty

🟡 Medium

Companies

Amazon, Google, Goldman Sachs

Notes

Language: Java
Inorder traversal visits nodes in ascending order. Stop at the kth node. Iterative inorder with a stack avoids full traversal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dfsDepth-first searchmediumMedium difficultytreeTree problems

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions