Internal path length of a binary tree with 15 nodes

algorithmstrees

I am a bit confused about internal path length. I understand it as being the sum of the depth of all nodes except the leaves. Thus I get the internal path length as 10 for a binary tree with 15 nodes. The thing is, my lecturer tells me it is 16. My book says it is the depth of all nodes, but that I get to 34. What am I doing wrong?

Best Answer

The answer was 16 because he meant a tree with 9 nodes, not 15. So a tree with 9 nodes has a sum depth of all nodes of 16.