Discussion:
A3Q3
(too old to reply)
Yiyao LIU
2011-10-22 23:48:04 UTC
Permalink
In the question A3Q3, height is denoted by i.
I am wondering, if there's is only one node, it's height 0 instead of
height 1, right?
( And we will be using this convention for all future questions except
special mention, right? )

Thank you:)
Jake Hoffmann
2011-10-23 01:29:41 UTC
Permalink
This appears to be the case.

From slide 87: "Let n_i denote the smallest number of nodes in an AVL
tree of height i. It is easy to compute some small values: n_0 = 1,
n_1 = 2, ..."

That is, the minimum number of nodes in a height 0 tree is 1. So trees
with 1 node have height 0.
Post by Yiyao LIU
In the question A3Q3, height is denoted by i.
I am wondering, if there's is only one node, it's height 0 instead of
height 1, right?
( And we will be using this convention for all future questions except
special mention, right? )
Thank you:)
cs240
2011-10-23 18:20:16 UTC
Permalink
Yes, a tree consists of one single node has height 0.

Vivian
CS240 Tutor
Post by Jake Hoffmann
This appears to be the case.
From slide 87: "Let n_i denote the smallest number of nodes in an AVL
tree of height i. It is easy to compute some small values: n_0 = 1,
n_1 = 2, ..."
That is, the minimum number of nodes in a height 0 tree is 1. So trees
with 1 node have height 0.
Post by Yiyao LIU
In the question A3Q3, height is denoted by i.
I am wondering, if there's is only one node, it's height 0 instead of
height 1, right?
( And we will be using this convention for all future questions except
special mention, right? )
Thank you:)
Loading...