Computer Science EngineeringHard

A union-find structure with union by rank and path compression supports each operation in amortized time

  1. A. O(log n)
  2. B. O(1) worst case
  3. C. O(sqrt n)
  4. D. O(alpha(n)), the inverse Ackermann function

Correct answer: D. O(alpha(n)), the inverse Ackermann function

Tarjan's analysis shows the amortized cost per operation is O(alpha(n)).

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic