如果您有一个字符串数组,以最快的顺序对该数组排序的最快方法是什么?
See java.util.Arrays.sort(Object[])
import java.util.*;
Arrays.sort(stringarray)
Arrays.sort() for now.
Also I heard that Josh Bloch is working on a much faster sort algorithm than the current mergesort. (I can't remember where, maybe in this interview . The new algorithm will perform better for partially sorted arrays and originates from a Python? sort implementation). Also see this question.
String[] Mystring = {"cat","lion", "dog", "mouse"};
Arrays.sort(Mystring);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.