gpt4 book ai didi

algorithm - 什么是容器,与其他数据结构有何区别?

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:05:40 24 4
gpt4 key购买 nike

当我学习 Skienna算法设计手册时,我遇到了一句话:

We use the term container to denote a data structure that permits storage and retrieval of data items independent of content.

我的问题是什么是容器?哪种数据结构是容器,与其他数据结构有什么区别?它是像列表、字典这样的集合类型还是不同的?这些是什么意思允许存储独立于内容的数据项检索

最佳答案

容器有一个经典的定义here :

In computer science, a container is a class, a data structure, or an abstract data type (ADT) whose instances are collections of other objects. In other words, they store objects in an organized way that follows specific access rules. The size of the container depends on the number of objects (elements) it contains. Underlying (inherited) implementations of various container types may vary in size and complexity, and provide flexibility in choosing the right implementation for any given scenario.

因此,答案是:

Container abstract data types include:

  • FIFO queues
  • LIFO stacks
  • Priority queues
  • Arrays and their derivatives
  • Linked lists
  • Lookup tables (LUTs)
  • Key-associated data structures
    • Sets, containing and indexing objects by value or by specific property;
    • Maps, associating to each key a "value" for lookup
  • Binary search trees (BSTs), particularly self-balancing BSTs
  • Hash tables

关于algorithm - 什么是容器,与其他数据结构有何区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58366844/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com