Collections.binarySearch() vs. List indexOf()

前端 未结 3 1454
既然无缘
既然无缘 2021-01-02 05:26

I have a list of more than 37K items, and I already implemented hashCode(), equals(), so I wonder Collections.binarySearch() can help

3条回答
  •  再見小時候
    2021-01-02 06:01

    You'll get even better performance by using a HashSet. That will take more space, though.

提交回复
热议问题