νΈλ¦¬ μκ³ λ¦¬μ¦Advanced
AVL νΈλ¦¬
1962λ Adelson-Velskyμ Landisκ° λ°λͺ ν μ΅μ΄μ μκ° κ· ν μ΄μ§ κ²μ νΈλ¦¬μ λλ€. μλΈνΈλ¦¬μ λμ΄ μ°¨μ΄λ₯Ό μ΅λ 1λ‘ μ μ§νμ¬ O(log n) μ°μ°μ 보μ₯ν©λλ€. μ½μ /μμ ν μ¬κ· νμ μν΄ λ€ κ°μ§ μ νμ νμ (LL, RR, LR, RL)μ μνν©λλ€. λ°μ΄ν°λ² μ΄μ€, νμΌ μμ€ν , 보μ₯λ λ‘κ·Έ μ°μ°μ΄ μ€μν κ³³μ μ¬μ©λ©λλ€.
#tree#self-balancing#rotation#binary-search-tree
Complexity Analysis
Time (Average)
O(log n)Expected case performance
Space
O(n)Memory requirements
Time (Best)
O(log n)Best case performance
Time (Worst)
O(log n)Worst case performance
π CLRS Reference
Introduction to Algorithmsβ’Chapter 13β’Section Notes
Watch rotations maintain balance!
Rotation Types
- β’ LL: Right rotation (left-heavy)
- β’ RR: Left rotation (right-heavy)
- β’ LR: Left-Right rotation
- β’ RL: Right-Left rotation
- β’ Balance factor: height(left) - height(right)
- β’ O(log n) for insert, delete, search
Step: 1 / 0
500ms
SlowFast
Keyboard Shortcuts
Space Play/Pauseβ β StepR Reset1-4 Speed
Real-time Statistics
Algorithm Performance Metrics
Progress0%
Comparisons
0
Swaps
0
Array Accesses
0
Steps
1/ 0
Algorithm Visualization
Step 1 of 0
Initialize array to begin
Default
Comparing
Swapped
Sorted
Code Execution
Currently executing
Previously executed
Implementation