Find the most common String in ArrayList()

后端 未结 12 947
无人及你
无人及你 2020-12-08 16:59

Is there a way to find the most common String in an ArrayList?

ArrayList list = new ArrayList<>();
list.add(\"t         


        
12条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 17:50

    i know this takes more time to implement but you can use heap data structure by storing in the nodes the count and the string information

提交回复
热议问题