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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -