just take the Binary tree,
root is A, left of root is B and right of root is C
left of B is D and right of D is E, and E right is F, F right child is G, G right child is H
right of C is J
What is the answer by you? ( as you said it is 5 due to D have only right child, E have only right child,F have only right child, G have only right child, and C have only right child, )
If you apply the algorithm, what is Answer? only 3.