Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Analysis of AVL/ Height Balanced Tree #31029

Merged
merged 2 commits into from May 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions guide/english/algorithms/avl-trees/index.md
Expand Up @@ -61,3 +61,14 @@ In RR Rotation every node moves one position to right from the current position.
The LR Rotation is combination of single left rotation followed by single right rotation. In LR Rotation, first every node moves one position to left then one position to right from the current position.
->Right Left Rotation (RL Rotation)
The RL Rotation is combination of single right rotation followed by single left rotation. In RL Rotation, first every node moves one position to right then one position to left from the current position.

Time Analysis Of AVL Tree:

AVL tree is binary search tree with additional property that difference between height of left sub-tree and right sub-tree of any node can’t be more than 1.

Algorithm Average Worst case
Space O ( n ) {\displaystyle O(n)} O(n) O ( n ) {\displaystyle O(n)} O(n)
Search O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n) O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n)
Insert O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n) O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n)
Delete O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n) O ( log ⁡ n ) {\displaystyle O(\log n)} O(\log n)