• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
June 26, 2023 |740 Views
Diameter of a Binary Tree - SDE Sheet
Description
Discussion

In this video, we will solve the problem "Diameter of a binary tree". The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. 

For Example: 

Input: 10
          /   \
        20    30
      /   \ 
   40   60

Output: 4

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/diameter-of-a-binary-tree/
Problem: https://practice.geeksforgeeks.org/problems/diameter-of-binary-tree/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

 

 

 

Read More