Data Structures & AlgorithmsHardICPC regional · strings

Problem: What is the time complexity of building a suffix array with prefix doubling and radix sort?

  1. A. O(n^2)
  2. B. O(n log n)
  3. C. O(n)
  4. D. O(n sqrt n)

Correct answer: B. O(n log n)

Each doubling round sorts pairs with radix sort in linear time, and there are log n rounds.

More Coding Interview Problems questions

Exams that ask this topic