æšæ§é ã¢ã«ãŽãªãºã Advanced
AVLæš
1962幎ã«Adelson-VelskyãšLandisã«ãã£ãŠçºæãããæåã®èªå·±å¹³è¡¡äºåæ¢çŽ¢æšã§ããå転ãéããŠé«ãã®ãã©ã³ã¹ãç¶æããO(log n)ã®æäœãä¿èšŒããŸããèµ€é»æšããã峿 Œãªãã©ã³ã·ã³ã°ã¯ãããŒã¿ããŒã¹ããã¡ã€ã«ã·ã¹ãã ãªã©ã®æ€çŽ¢ãå€ãã¢ããªã±ãŒã·ã§ã³ã«çæ³çã§ãã
#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