data structures - AVL tree worst case number of rotations during insertion and deletion -


in avl tree, worst case number of rotations during insertion , deletion of n elements ?

i think insertion should o(n) , deletion should o(nlogn). however, not sure deletion .

am correct?

for both operations - inserting or deleting of node x, there cases require rotations made on nodes x root. since height of tree n nodes o(log n), worst case both operations take o(log n) rotations. n insert/delete operations gives o(n log n).


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -