Count number of items with property

后端 未结 10 2543
不思量自难忘°
不思量自难忘° 2021-02-13 12:18

I have list List where Custom is like

class Custom{
    public int id;
    public String name;
}

How to

10条回答
  •  孤独总比滥情好
    2021-02-13 12:50

    You could also sort the list before looping, then use divide-and-conquer to find matches, then count. It really depends on your needs, like how many elements? Are there a lot of insertions after a search? etc

提交回复
热议问题