Java数据结构/ C++ STL等价物?

Moh*_*hit 9 java

我刚开始学习java.我已经了解C++和python.为了学习Java,我有点从我在C++中所知道的类比.我是C++中的STL库(矢量,deques,堆栈,哈希映射)的狂热用户http://www.sgi.com/tech/stl/stl_introduction.html

与此同时,python也有标准的dicts,list等,可以在他们的文档中轻松搞定.

我最近一直在谷歌搜索在Java中找到STL等价物,但我无法找到它?有人能指出我正确的资源吗?

谢谢

Com*_*vis 7

  1. std::vector -> juArrayList
  2. std::unordered_map -> juHashMap
  3. std::map -> juTreeMap
  4. std::set -> juLinkedHashSet
  5. std::unordered_set -> juHashSet
  6. std::stack -> juArrayDeque(不推荐使用 juStack),
  7. std::queue -> 使用 juLinkedList(也看看 juArrayBlockingQueue)。
  8. std::priority_queue -> juPriorityQueue
  9. std::span -> 没有明确的类似物
  10. std::deque -> juArrayDeque
  11. std::list -> juLinkedList
  12. std::forward_list -> 没有类似物

重要提示:上述关联具有相似的 API,但可能具有不同的操作和实现渐近线。

注意:j.u表示java.util