Home  >  Q&A  >  body text

java - 对list中的元素进行排序

对一个size大小在30w以上的List<Map<String ,Object>> list中的map依据map中某个键值对的值进行排序,速度快吗

伊谢尔伦伊谢尔伦2716 days ago446

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 17:50:57

    Use the Collections.sort method directly. This method uses merge sort, and the time complexity is nlg(n). If you want to go faster, you need to analyze specifically which sorting algorithm is more suitable for your data.

    reply
    0
  • Cancelreply