codesONLY / JavaScriptONLY

Knowledge Resource of core fundamentals of JavaScript explained in simple way!
382 stars 181 forks source link

Diameter of Binary Tree #68

Closed DEV-AB-03 closed 2 years ago

DEV-AB-03 commented 2 years ago

Here I have proposed the solution for one of the most famous interview questions asked in the "FAANG" companies in Binary Trees Data Structure. Here I have used "Depth First Search" traversal technique to calculate maximum depth of root node and thus will be equal to the diameter of the given binary tree.

sohamsshah commented 2 years ago

Thanks for this addition!