menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Leetcode P...
source image

Medium

3w

read

175

img
dot

Image Credit: Medium

Leetcode POD: 2415. Reverse Odd Levels of Binary Tree

  • Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.
  • Return the root of the reversed tree.
  • A binary tree is perfect if all parent nodes have two children and all leaves are on the same level.
  • To reverse the values on odd levels, a single-traversal solution without any extra space is implemented using pre-order traversal.

Read Full Article

like

10 Likes

For uninterrupted reading, download the app