Ben Bacarisse
4/19/2016 1:28:00 AM
Richard Heathfield <rjh@cpax.org.uk> writes:
> On 19/04/16 01:55, Ben Bacarisse wrote:
>> Richard Heathfield <rjh@cpax.org.uk> writes:
>>
> <snip>
>>
>>> Let's show it for h = 4:
>>>
>>> 1:...........*...........
>>> 2:.....*...........*.....
>>> 3:..*.....*.....*.....*..
>>> 4:.*.*...*.*...*.*...*.*.
>>>
>>> At level 4, we have 8 = 2^(4-1) nodes, not 16 = 2^4 nodes.
>>
>> Most people would call that a tree of height 3. I've never seen your
>> counting used for tree height, but I have led a sheltered life.
>
> One can envisage nodes in a tree as if they were rooms in a building,
> and the height is the number of storeys. h=4
>
> One can envisage nodes in a tree as if they were posts in a fence, and
> the height is the number of fence-rails you need. h=3
One could, but why would one? Why is that analogy better than others
where height is usually a measured length? Or, more exactly, given that
there is an established usage, are the benefits of your usage enough to
outweigh the resulting confusion? At the moment I see no advantages at
all.
Do you use the same counting for depth? Does the root have depth 1?
> Both make sense. I think my way makes more sense, but then I would,
> wouldn't I?
Starting out saying "no" is a bit strong then! Saying "There are two
ways to measure the height and I'm using the less usual one" wouldn't
have been so confrontational.
--
Ben.