If comparison based sorting algorithm is used construct the suffix array, then what will be time required to construct the suffix array?

Quang Hiếu

New member
If comparison based sorting algorithm is used construct the suffix array, then what will be time required to construct the suffix array?
A. O(nlogn)
B. O(n$^{2}$)
C. O(n$^{2}$logn)
D. O(n$^{2}$) + O(logn)
 
Answer: c
Explanation: On average comparison based sorting algorithms require O(nlogn) comparisons. But comparing a suffix takes O(n). So, overall time to construct the suffix array will be O(nlogn) * O(n) = O(n$^{2}$logn).
 

Tìm kiếm

Back
Top