← Microsoft questions

Delete leaf nodes with specific value

Filed under Microsoft

Given a binary tree and a target value, delete all leaf nodes that have a value equal to the target. If removing a leaf node causes its parent to become a new leaf node with the target value, it must…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.