← Goldman Sachs questions

Convert a binary tree into a full binary tree

Filed under Goldman Sachs

Given a binary tree, remove all nodes that have only one child, transforming it into a full binary tree where every node has either 0 or 2 children. Return the root of the modified tree.

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 Goldman Sachs questions

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