Data Structures & AlgorithmsHardICPC regional · strings
Problem: What is the time complexity of building a suffix array with prefix doubling and radix sort?
- A. O(n^2)
- B. O(n log n)
- C. O(n)
- 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
- Problem: Which problem is solved by the Aho-Corasick automaton?
- Problem: Which claim about the centroid decomposition of a tree is correct?
- Problem: What is the complexity of answering distance queries on a tree after O(n log n) preprocessing with the sparse-table LCA?
- Problem: In a Fenwick tree over n positions, what is the cost of a range-sum query combined with point updates?
- Problem: Which property must a function have for ternary search to find its maximum correctly?
- Problem: Dijkstra with a binary heap on a graph with E = 10^6 edges and V = 10^5 vertices runs in roughly how many elementary operations?