Common data structures ---

Source: Internet
Author: User

Common Data Structures

In the development of computer science, data structures are also evolving. Currently, data structures commonly used in programming include the following:

1. Array)

An array is an aggregation data type that organizes several variables of the same type in an orderly manner. Arrays can be the most basic data structure and correspond to each other in various languages. A data array can be divided into multiple array elements. According to the data element type, the array can be divided into integer array, complex array, floating point array, object array, and so on. Arrays can also have one-dimensional, two-dimensional, and multi-dimensional representations.

2. Stack)

Stack is a special linear table. It can only insert and delete data nodes at a fixed end of a table. The stack stores data according to the principle of "back-in-first-out". That is to say, the first inserted data is pushed to the bottom of the stack, and the last inserted data is at the top of the stack. When reading data, read from the top of the stack one by one. Stacks are often used for field protection of important data in assembly languages. When there is no data in the stack, it is called an empty stack.

3. Queue)

A queue is similar to a stack and a special linear table. Unlike the stack, a queue can only insert data at one end of the table and delete data at the other end. In general, the end of the insert operation is called the end of the team, and the end of the delete operation is called the opposite. When there are no elements in a queue, it is called an empty queue.

4. Linked List)

A linked list is a data structure where data elements are stored in a chained storage structure. This storage structure is physically discontinuous. A linked list consists of a series of data nodes. Each data node consists of two parts: data domain and reference domain. The reference domain stores the address of the next element in the data structure. The logical order of data elements in the linked list structure is achieved through the reference link order in the linked list.

5. Tree)

A tree is a typical non-linear structure. It contains a finite combination K of n nodes. In the tree structure, there is only one root node, and this node does not have a precursor node. Other nodes in the tree structure have only one parent node, and can have m successor nodes, m slave 0.

6. Graph)

The graph is another non-linear data structure. In the graph structure, data nodes are generally called vertices, while edges are the ordered even pairs of vertices. If an edge exists between two vertices, the two vertices are adjacent.

7. Heap)

Heap is a special tree-type data structure. The heap we generally discuss is a binary heap. The heap feature is that the value of its root node is the smallest or largest of all nodes, and the two subtree of the root node is also a heap structure.

8. Hash)

The Hash function is derived from the Hash function. The idea is that if a record with the same keyword and T exists in the structure, then F (T) must be used) you can find the record in the storage location of the log, so that you can directly obtain the queried record without comparing it.

This article is from the TinyKing blog, please be sure to keep this source http://tinyking.blog.51cto.com/3338571/1297936

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.