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.