### Height or Depth of Binary Tree

hi,

i'm in interested to know what will be the height of binary tree with say 5 nodes (consider it balanced)

is it 2 or 3?
 ``12345`` `````` 9 / \ 5 13 / \ 3 7``````

and for following tree also:
 ``1234567`` `````` 2 / \ 7 5 / \ \ 2 6 9 / \ / 5 11 4``````

is it 3 or 4?

the algo i find is:

 ``12345`` ``````depth(struct tree*t) { if ( t == NULL) return 0; return max( depth(tree->left), depth(tree->right) ) + 1; }``````

according to it, ans for second will be 4
But as per image on wikipedia (url: http://en.wikipedia.org/wiki/Binary_tree )
the ans is 3

Wikipedia on trees: "The root node has depth zero."
so, what will be the answer?

Is the algo mentioned in my early post is correct or not, to find the depth?
ok, height (or depth) of empty (or null) binary tree is ZERO

and considered there is only one node in tree, then height of root node is zero but height of tree is one

that means, the height of following tree is 4 and not 3 (its something not right on wikipedia)

 ``1234567`` `````` 2 / \ 7 5 / \ \ 2 6 9 / \ / 5 11 4``````

depth of above tree is 4