Java - Collections.sort() performance

后端 未结 5 1385
孤街浪徒
孤街浪徒 2020-12-30 02:59

I\'m using Collections.sort() to sort a LinkedList whose elements implements Comparable interface, so they are sorted in a natural order. In the javadoc documentation its sa

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 03:43

    There is no general sort algorithm better than n*log(n). And this is quite fast. By general I mean your data doesn't have special properties.

提交回复
热议问题