← Morgan Stanley questions

Delete k nodes of minimum depth in a binary tree

Filed under Morgan Stanley

Given a binary tree and an integer k, delete k nodes that have the smallest depth in the tree. When a node is deleted, typically its children are promoted or handled such that the tree structure…

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 Morgan Stanley questions

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