What is the Big O efficiency of the AVL tree rotation specifically?
For example when inserting: - O(logN) to search for the position - O(1) to insert - ? for balancing (if it needs to be re-balanced)
I thought it would be O(logN) but I found a site which claims it's O(1) - unless I have misread it - http://users.informatik.uni-halle.de/~jopsi/dinf504/chap4.shtml
(Would this also be the same for a 2-3 tree?)
Thanks for the help in advance
The complexity is O(log n) as you say. I believe that in the article they mean constant time for each rebalancing operation i.e. each rotation, while you have to do O(log n) rotations. Whatever the truth the complexity is as you say logarithmic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With