First page Back Continue Last page Summary Graphic
AVL Insertion Analysis
Insertion Cost
- basicInsertion Q( ) +
- reBalance
- number of iteration: Q( )
- cost of an iteration: O( )
- Overall cost: O( )
Can we do any better ?
- Of course! Avoid the computation of height()
- Store the height in the BTNode
- Maintain height as tree gets restructured
- Final cost with optimization: Q( )