3

PROBLEM OF THE DAY : 08/02/2024 | Check if all leaves are at same level

 7 months ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-08022024-check-if-all-leaves-are-at-same-level/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Check if all leaves are at same level

February 09, 2024 |90 Views
PROBLEM OF THE DAY : 08/02/2024 | Check if all leaves are at same level
Problem of the Day, Data Structures and Algorithms, binary-tree
 Save  Share   Like
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Binary Tree but also build up problem-solving skills.

In this problem, we are given a binary tree with n nodes, determine whether all the leaf nodes are at the same level or not. Return true if all leaf nodes are at the same level, and false otherwise.

Example :

Input:
Tree:
   1
  / \
 2   3
Output:
true
Explanation:
The binary tree has a height of 2 and the leaves are at the same level.

Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/leaf-at-same-level/1

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK