String str[] = {"Hello", "World", "John", "Doe"}; Arrays.sort(str); System.out.prinltn(Arrays.toString(str));
我知道 Arrays.sort(int[]) 的时间复杂度为 O(nlgn)。但是字符串数组呢。由于排序字符串数组在内部使用 compareTo 函数来比较两个字符串。它会改变等式吗?
java arrays string time time-complexity
arrays ×1
java ×1
string ×1
time ×1
time-complexity ×1