A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst-case running time of this computation is:
Show Hint
Combine the sorting algorithm complexity with the cost of comparisons for string-based sorting problems.
- Merge sort operates in O(n log n) for n elements. - When sorting n strings of length n, each comparison between two strings takes O(n) due to the length of the strings. - Thus, the total time complexity becomes: O(n · n log n) = O(n2 log n).