UGC-NET Sep 2013 · Divide & Conquer: Mergesort

MCQ · 2 marks · Problem PROG-DIVC-0015

The amortized time complexity to perform operation(s) in Splay trees is O(Ig n)
  1. A
    Search
  2. B
    Search and Insert
  3. C
    Search and Delete
  4. D
    Search, Insert and Delete

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionA splay tree moves every accessed node to the root by rotations (splaying). The potential-function analysis shows that a splay costs \(O(\lg n)\) amortized, and search, insert and delete each consist of a constant number of splays plus \(O(1)\) extra work.\[\text{Search, Insert, Delete: } O(\lg n)\ \text{amortized each.}\]A single operation can still take \(O(n)\) in the worst case, but any sequence of \(m\) operations costs \(O(m\lg n)\).Answer: D

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com