C++ 中还有哪些其他可用的数据结构?标准格式?

发布于 2024-10-07 10:29:51 字数 293 浏览 0 评论 0原文

我已经知道以下内容:

  • 数组
  • 位集
  • 哈希映射和集合
  • 常规映射和集合
  • 迭代器
  • 列表对
  • 元组
  • 队列
  • 、双端队列和优先级队列
  • 堆栈
  • valarrays
  • 向量

C++ 库中是否有任何其他类型的数据结构可用。我特别寻找的是图表,但我还想知道还有什么。

另外,我想知道是否有任何外部库可以与我的项目链接来实现图表。

I'm already aware of the following:

  • arrays
  • bitsets
  • hash maps and sets
  • regular maps and sets
  • iterators
  • lists
  • pairs
  • tuples
  • queues, deques, and priority queues
  • stacks
  • valarrays
  • vectors

Is there any other type of data structure available in the C++ library. What I'm specifically looking for is graphs, but I'd also like to know what else is there.

Also, I'd like to know if there are any external libraries I can link with my projects to implement a graph.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心如荒岛 2024-10-14 10:29:51

它是“C++ 标准库”或类似的东西,而不是“STL”。该术语指的是某些特定数据结构和算法的初始草案。并非所有这些都进入了标准库,并且标准库还包含其他内容(例如,所有 iostream 类)。

对我来说,这看起来像是一个完整的列表(您似乎在专门谈论 C++0x,因为您提到了元组和数组)。我不知道我是否会认为位集和迭代器是“数据结构”,但我想这是一个公平的描述。

肯定没有图形实现。很遗憾。 :( 不过,你可以从 Boost 获得一个。

It's "the C++ standard library" or something to that effect, not "the STL". That term refers to an initial draft of some specific data structures and algorithms. Not all of them made it into the standard library, and the standard library also contains other stuff (for example, all the iostream classes).

That looks like a complete list to me (you appear to be talking specifically about C++0x, since you mention tuples and arrays). I don't know if I would even consider bitsets and iterators to be "data structures", but I guess that's a fair description.

There is definitely not a graph implementation. Unfortunately. :( You can get one from Boost, though.

舟遥客 2024-10-14 10:29:51

STL 分为三个部分:

  • 容器
  • 迭代器
  • 算法

显然您已经找到了容器部分,并且您可能已经使用了与容器相关的迭代器。但迭代器的功能比您发现的还要多。

算法部分通过迭代器链接到容器。而且还包含部分句柄函子和相关联的绑定器。

我最喜欢的网站是: http://www.sgi.com/tech/stl /table_of_contents.html

除了标准库之外,您还应该看看 boost 库:

另请参阅:增强库

The STL is divided into three parts:

  • Containers
  • Iterators
  • Algorithms

You have obviously found the containers part and you have probably used the iterators associated with the containers. But there is even more to the iterators than you have found.

The algorithms sections is linked to the containers via iterators. But also contains the parts handle functors and associated binders.

My favortie site for this is: http://www.sgi.com/tech/stl/table_of_contents.html

In addition to the standard libraries you should have a look at the boost libraries:

see also: Boost Library

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文