Design an algorithm for finding the path length of a binary tree. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Design an algorithm for finding the path length of a binary tree.

Hi! Can you help me find an algorithm that calculates the path length of an arbitrary binary tree, which complexity is O(n-h), where n is the number of nodes and h is the height of the tree?

4th Dec 2022, 1:09 AM
KHADIJA AI
KHADIJA AI - avatar
2 Answers
+ 5
KHADIJA AI , > can you please link your attempt for this exercise here?
4th Dec 2022, 7:29 AM
Lothar
Lothar - avatar
0
no one is going to do your homework for you. either search google or show what you have done so others can assist you
4th Dec 2022, 2:06 AM
Yusuf C