← Microsoft questions

Delete leaf nodes with target value in binary tree

Filed under Microsoft

Given a binary tree and an integer target, remove all leaf nodes with value equal to target. If deleting a leaf node makes its parent a leaf node with the target value, that parent must also be…

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.