Search
⌘K

Leetcode 156. Binary Tree Upside Down

Transform a binary tree by flipping it upside down so the original leftmost node becomes the new root and each parent becomes the right child while the original right child becomes the left child. The challenge is to rewire node pointers along the left spine (in-place, O(n) time) to produce the new tree structure.

Asked at:

LinkedIn

LinkedIn


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late October, 2025

LinkedIn

LinkedIn

Senior

Given the root of a binary tree, turn the tree upside down and return the new root. Both recursive + iterative approaches were expected.

Comments

Your account is free and you can post anonymously if you choose.