
Data structures are widely used in computer science for storage of data. They refer to the allocation and storage of data in varied ways. This Techspirited post gives you an overview of the different types of data structures used in computer science, and their various applications.
队列vs。堆
尽管队列和堆栈都执行相同的数据存储操作,但它们在数据存储和删除策略方面有所不同。该堆栈遵循LIFO(首先是最后一次)模式,该模式删除了在其中最短时间的数据。鉴于队列遵循FIFO(首先是首先)模式,该模式定义了首先存储的数据的删除。
什么是数据结构?数据结构是以非常有效的方式存储数据的手段。每个结构都有不同的方式插入,删除或查询数据。
Further, these structures are divided into two main categories depending on data types: primitive and non-primitive. Primitive types refer to the most basic data types used. They are considered as the building blocks for any type of data. The data types that belong to this category are: character, float, long, double, integer, enum, and boolean. Non-primitive types refer to those in which the data is not stored directly, and is referenced using an index. This type further branches into arrays, files, and lists. List structures are linear or non-linear, based on their structure. Given below are the different non-primitive data structures, along with their practical uses.
计算机科学中不同类型的数据结构
数据结构可以根据访问数据的方式是线性或非线性。线性是按顺序存储数据的,并且也可以按顺序访问。非线性是将数据固定在一起而不关注其序列的那些线性。数据不能按顺序排列或访问。

An array refers to a set of similar elements. It consists of an index. This acts as a pointer to each element of this structure. Unlike most other data storage types, arrays have a fixed length. Its elements are placed in a contiguous fashion. Each of the data item has a fixed memory address. An array can have rows and columns as well. If the value of the index is given for a single record, the values of the other records can be computed with an easy mathematical calculation.
应用程序:Implementation of other data structures, Execution of matrices and vectors, Dynamic memory allocation, Pointer container, Control tables

堆栈是指有序的数据安排。它仅由一端组成。此末端都用于数据添加和删除。据说遵循LIFO模式,这意味着要输入的最后一个数据项是第一个要删除的数据项。有时也将其称为“下降堆栈”。“推送”和“ pop”是此数据结构的两个功能。推动是添加数据的定义的函数,POP用于弹出或删除数据。
应用程序:Evaluation of expressions, Backtracking, Runtime memory management, Arrangement of books in a library

队列是具有线性图案的列表,具有两端:前后。前端允许从列表中删除数据项。后端可以将数据项插入列表中。如果队列,则无需立即处理输入数据。实际上,数据以FIFO方式处理。对于在不同过程之间传输数据的方案,这是非常有效的。
在这里,发送发送的数据不必以发送的速率相同。在不同的过程之间将共享某个系统资源。
应用程序:Disk scheduling, CPU scheduling, File IO, Data transmission

A linked list is a collection of objects which are linked to each other in a linear pattern. Each of these objects is called a node. The first object is called the front node or the head. Each of the nodes store some data in them. One important feature of this type of list is that the data is not stored in contiguous locations. Every object has two components – one is the data part and the other is the address of the node to which it is pointing. The nodes are not continuous, and can lie in any part of the memory.
应用程序:稀疏矩阵的表示,非连续数据存储,非二进制树或其他数据结构的实现,动态内存管理,均衡括号,符号表

Finite set is a mathematical concept, based on which the ‘set’ storage type is implemented. This data structure consists of mathematical functions defining the conditions and elements belonging to it. A variation of this structure is the static set implemented to ensure that no change is done to the data after the structure is constructed. However, the stored data can be accessed by querying the structure.
另一个变化是动态集,该集合允许在集合中添加或删除元素。
应用程序:数据映射,通用数据存储

A graph consists of a bounded set of nodes (also termed as vertices). A pair of two nodes is called an edge. Each node has some data associated with it. Whereas, the edges indicate the pointers between the nodes. For two nodes ‘a’ and ‘b’, its edge can be represented as (a,b). This type of structure represents the concept of graphs in mathematics.
应用程序:计算机网络,涉及“深度优先”搜索或“广度优先”搜索算法的问题解决方案,矩阵的表示,化学分子相互作用的研究

一棵树由一组通过指针链接的节点组成。每个结构都有一个根节点和包含其余数据节点的分支。如果有序树,则将节点或对象按顺序排序。如果有一棵无序的树,则不存在订购。没有数据或节点的树称为空树或空树。
应用程序:表示的数据列表,传播开来y accessible data storage, Representation of hierarchal data, Routing of algorithms

Hash table is a type of table whose main function, in addition to data storage, is mapping the keys to values. The table has some keys to be mapped, a hash function, and buckets. Each bucket is an array which stores data. The role of the hash function is to map the keys to the buckets. Each key is allotted to a unique bucket. This structure also accommodates the feature that multiple keys will be
由表的哈希函数分配给同一存储桶。
应用程序:独特的数据表示,cach的实现es, Array association, Locating entries in a table, Representation of objects, Database indexing

文件是多个记录的集合。每个记录由一个或多个元素组成。这些元素称为字段。在此数据结构的情况下,每个记录都会分配一个字段和一个键。该数据结构与数组不同,因为在前者中,每个记录可能具有不同的数据类型。
应用程序:计算机程序的实施,数据比较,具有不同数据类型的数据的存储
对于那些不知道数据结构的作用和功能的人来说,上述类型必须是一个很好的概述。他们肯定是存储我们信息的最佳方法。