Data Structures & AlgorithmsVery hardICPC regional · offline queries

Problem: What is the time complexity of the 'Mo's algorithm with updates' (time dimension added) in terms of n and q?

  1. A. O(n log n)
  2. B. O(n^2)
  3. C. O(n^(5/3))
  4. D. O(q)

Correct answer: C. O(n^(5/3))

Adding a time dimension to Mo's algorithm balances block sizes to about n^(2/3), giving O(n^(5/3)) total.

More Coding Interview Problems questions

Exams that ask this topic