java数据结构类型_数据结构类型

java数据结构类型

Data structures are a very important programming concept. They provide us with a means to store, organize and retrieve data in an efficient manner. The data structures are used to make working with our data, easier. There are many data structures which help us with this.

数据结构是一个非常重要的编程概念。 它们为我们提供了一种以有效方式存储,组织和检索数据的方法。 数据结构用于简化我们的数据处理。 有许多数据结构可以帮助我们实现这一目标。

数据结构类型 (Types of Data Structures)

Types of Data Structures

Image Source

图片来源

原始数据结构 (Primitive Data Structures)

These are the structures which are supported at the machine level, they can be used to make non-primitive data structures. These are integral and are pure in form. They have predefined behavior and specifications.

这些是机器级别支持的结构,可用于创建非原始数据结构。 这些是必不可少的,而且形式纯正。 它们具有预定义的行为和规范。

Examples: Integer, float, character, pointers.

示例:整数,浮点数,字符,指针。

The pointers, however don’t hold a data value, instead, they hold memory addresses of the data values. These are also called the reference data types.

但是,指针不保存数据值,而是保存数据值的内存地址。 这些也称为参考数据类型。

非原始数据结构 (Non-primitive Data Structures)

The non-primitive data structures cannot be performed without the primitive data structures. Although, they too are provided by the system itself yet they are derived data structures and cannot be formed without using the primitive data structures.

没有原始数据结构就无法执行非原始数据结构。 尽管它们也是由系统本身提供的,但是它们是派生的数据结构,如果不使用原始数据结构就无法形成。

The Non-primitive data structures are further divided into the following categories:

非原始数据结构进一步分为以下几类:

1.数组 (1. Arrays)

Arrays are a homogeneous and contiguous collection of same data types. They have a static memory allocation technique, which means, if memory space is allocated for once, it cannot be changed during runtime. The arrays are used to implement vectors, matrices and also other data structures. If we do not know the memory to be allocated in advance then array can lead to wastage of memory. Also, insertions and deletions are complex in arrays since elements are stored in consecutive memory allocations.

数组是相同数据类型的同构和连续集合。 它们具有静态内存分配技术,这意味着,如果内存空间被分配一次,则无法在运行时更改它。 数组用于实现向量,矩阵以及其他数据结构。 如果我们不知道要预先分配的内存,那么数组会导致内存浪费。 而且,由于元素存储在连续的内存分配中,因此插入和删除在数组中很复杂。

2.档案 (2. Files)

A file is a collection of records. The file data structure is primarily used for managing large amounts of data which is not in the primary storage of the system. The files help us to process, manage, access and retrieve or basically work with such data, easily.

文件是记录的集合。 文件数据结构主要用于管理不在系统主存储中的大量数据。 这些文件可帮助我们轻松地处理,管理,访问和检索这些数据或基本使用这些数据。

3.清单 (3. Lists)

The lists support dynamic memory allocation. The memory space allocated, can be changed at run time also. The lists are of two types:

列表支持动态内存分配。 分配的内存空间也可以在运行时更改。 列表有两种类型:

a) Linear Lists

a)线性列表

The linear lists are those which have the elements stored in a sequential order. The insertions and deletions are easier in the lists. They are divided into two types:

线性列表是那些具有按顺序存储的元素的列表。 列表中的插入和删除更加容易。 它们分为两种类型:

  • Stacks: The stack follows a “LIFO” technique for storing and retrieving elements. The element which is stored at the end will be the first one to be retrieved from the stack. The stack has the following primary functions:

    堆栈:堆栈遵循“ LIFO”技术来存储和检索元素。 最后存储的元素将是要从堆栈中检索的第一个元素。 堆栈具有以下主要功能:

    • Push(): To insert an element in the stack.

      Push():在堆栈中插入一个元素。

    • Pop(): To remove an element from the stack.

      Pop():从堆栈中删除一个元素。

    Stacks: The stack follows a “LIFO” technique for storing and retrieving elements. The element which is stored at the end will be the first one to be retrieved from the stack. The stack has the following primary functions:

    堆栈:堆栈遵循“ LIFO”技术来存储和检索元素。 最后存储的元素将是要从堆栈中检索的第一个元素。 堆栈具有以下主要功能:

  • Queues: The queues follow “FIFO” mechanism for storing and retrieving elements. The elements which are stored first into the queue will only be the first elements to be removed out from the queue. The “ENQUEUE” operation is used to insert an element into the queue whereas the “DEQUEUE” operation is used to remove an element from the queue.

    队列:队列遵循“ FIFO”机制来存储和检索元素。 首先存储到队列中的元素只会是要从队列中删除的第一个元素。 “ ENQUEUE”操作用于将元素插入队列中,而“ DEQUEUE”操作用于从队列中删除元素。

b) Non Linear Lists The non linear lists do not have elements stored in a certain manner. These are:

b)非线性列表非线性列表没有以某种方式存储的元素。 这些是:

  • Graphs: The Graph data structure is used to represent a network. It comprises of vertices and edges (to connect the vertices). The graphs are very useful when it comes to study a network.

    图形:图形数据结构用于表示网络。 它由顶点和边组成(用于连接顶点)。 这些图对于研究网络非常有用。

  • Trees: Tree data structure comprises of nodes connected in a particular arrangement and they (particularly binary trees) make search operations on the data items easy. The tree data structures consists of a root node which is further divided into various child nodes and so on. The number of levels of the tree is also called height of the tree.

    树:树数据结构包括以特定排列方式连接的节点,它们(尤其是二叉树)使对数据项的搜索操作变得容易。 树数据结构由一个根节点组成,该根节点又分为各种子节点,依此类推。 树的级别数也称为树的高度。

影片教学 (Video Tutorial)

翻译自: https://www.thecrazyprogrammer.com/2018/10/types-of-data-structures.html

java数据结构类型

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值