← Bloomberg questions
CodingReported in a candidate post, Jul 2025

Sort the children of each node in a tree

Filed under Bloomberg

Each tree node holds a value and a list of children. Sort the children of every node (by value, ascending), carrying each child's whole subtree along, and return the root. The sort key is assumed to…

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 Bloomberg questions

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