Remove Half Nodes | Binary Tree | GFG POTD | C++ | Java | Code Kar Lo

preview_player
Показать описание
You are given a binary tree and you need to remove all the half nodes (which have only one child). Return the root node of the modified tree after removing all the half-nodes.

Note: The output will be judged by the inorder traversal of the resultant tree, inside the driver code.

0:00 Introduction
0:10 Problem Statement
1:10 Explanation
7:05 C++ Code
10:50 Java Code

gfg potd
gfg potd today
gfg problem of the day
potd gfg
potd
potd today
gfg

#dsa #datastructures #algorithm #gfg #potd #coding #array #strings #tree #binarysearchtree #codekarlo #dynamicprogramming
Рекомендации по теме
Комментарии
Автор

bhai leaf node vaala case toh likha hi nhi aapne :
if(!root->left && !root->right)
return root;

VivekKumar-glvo
welcome to shbcf.ru