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
Post a Comment