Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
AVL tree
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Properties=== Balance factors can be kept up-to-date by knowing the previous balance factors and the change in height β it is not necessary to know the absolute height. For holding the AVL balance information, two bits per node are sufficient.<ref>However, the balance information can be kept in the child nodes as one bit indicating whether the parent is higher by 1 or by 2; thereby higher by 2 cannot occur for both children. This way the AVL tree is a [[WAVL tree|"rank balanced" tree]], as coined by [[#Haeupler|Haeupler, Sen and Tarjan]].</ref> The height <math>h</math> (counted as the maximal number of levels) of an AVL tree with <math>n</math> nodes lies in the interval:<ref name="Knuth" />{{rp|460}} :<math>\log_2(n+1) \le h < \log_\varphi(n+2) + b</math> where <math>\varphi := \tfrac{1+\sqrt 5}2 \approx 1.618</math> is the [[golden ratio]] and <math>b := \frac{\log_2 5}{2 \log_2 \varphi} - 2 \approx \; -0.3277 .</math> This is because an AVL tree of height <math>h</math> contains at least <math>F_{h+2}-1</math> nodes where <math>\{F_n\}_{n\in\N}</math> is the [[Fibonacci number|Fibonacci sequence]] with the seed values <math>F_1=F_2=1 .</math>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
AVL tree
(section)
Add topic