Search
⌘K

Leetcode 538. Convert BST to Greater Tree

Given a BST, update each node's value to be its original value plus the sum of all greater node values, performing the transformation in-place. The typical solution uses a reverse in-order traversal to maintain a running suffix sum across nodes (up to 10^4 unique node values).

Asked at:

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early October, 2025

Microsoft

Microsoft

Mid-level

Early October, 2025

Microsoft

Microsoft

Mid-level

Same question, was only asked to write the function signature. Dry run the code

Comments

Your account is free and you can post anonymously if you choose.