Does geeksforgeeks website has an error regarding maximum number of nodes in a tree?

52 Views Asked by At

I know that for a tree with a given height H, the maximum number of nodes on all levels is $n \le 2^0 + 2^1 + 2^2+...+2^H = 2^{H+1}-1$. Basically it's for Perfect Binary Tree.

How come that this well known website says that it's $2^H$? (they use 2^x in the website).