Java是否具有像C ++ STL中那样的多集数据结构? [英] Does Java have a multiset data structure like the one in C++ STL?

查看:102
本文介绍了Java是否具有像C ++ STL中那样的多集数据结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个与STL多集类似的数据结构,但是Java中的TreeSet不允许重复的元素。 Java中是否有等效于多集的内置数据结构?

I need a data structure which works like the STL multiset but the TreeSet in Java doesn't allow duplicate elements. Is there any built-in data structure in Java which is equivalent to multiset?

推荐答案

标准Java库中没有Multiset。您应使用包含Multiset类的Google Guava框架。
请参见

There is no Multiset in the standard Java libraries. You should use the Google Guava framework which contains Multiset classes. See

这篇关于Java是否具有像C ++ STL中那样的多集数据结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆