Zulfi Khan2
November 27th, 2005, 06:47 AM
Hi,
I have read in a book(Fundamentals of Algorithm by cormen p=144, MIT Press) that subtree size is 2n/3. When I searched the web I got following :
Left Subtree:
1+....+ 2^(h-1)= 2^h -1
Right Subtree:
1+....+ 2^(h-2)= 2^(h -1)-1
Tree:
1+2^h -1+2^(h -1)-1
=2^h+2^(h-1)-1=n
Subtree size=(2^h-1)/2^h+2^(h-1)-1 * n <2n/3
Can somebody explain me the above?
Zulfi.
I have read in a book(Fundamentals of Algorithm by cormen p=144, MIT Press) that subtree size is 2n/3. When I searched the web I got following :
Left Subtree:
1+....+ 2^(h-1)= 2^h -1
Right Subtree:
1+....+ 2^(h-2)= 2^(h -1)-1
Tree:
1+2^h -1+2^(h -1)-1
=2^h+2^(h-1)-1=n
Subtree size=(2^h-1)/2^h+2^(h-1)-1 * n <2n/3
Can somebody explain me the above?
Zulfi.