# Data Structure basics 1

Source: Internet
Author: User

Data structures are used by computers to store and organize data. A good data structure can improve the running or storage efficiency. The data structure is often related to the retrieval algorithm and indexing technology.

The design process of a data structure is divided into abstraction layer, data structure layer, and implementation layer. The abstraction layer refers to the abstraction data type layer, which discusses the logical structure of data and its operations, the data structure layer and Implementation Layer discuss the representation of a data structure, the storage details of a computer, and the implementation of operations.

A Data Structure is organized by data elements based on certain logical connections. The description of the logical relationship between data elements is called the logical structure of data. Data must be stored in a computer, and the data storage structure is the implementation form of the data structure, which is expressed in a computer; in addition, to discuss a data structure, we must also discuss the operations performed on this type of data to make sense.

Data structure refers to the relationship between data elements in the same data element class. The data structures are logical structures, storage structures (physical structures), and data operations. The logical structure of data refers to the description of the relationship between data. Sometimes, the logical structure is referred to as the data structure. The logical structure is defined as (K, R) (or (d, S). k is the finite set of data elements, and r is the finite set of relations on K.

Array)

In programming, several variables of the same type are organized in an orderly manner to facilitate processing. The collections of these sort-by-order data elements are called arrays. In C, arrays are constructed data types. An array can be divided into multiple array elements, which can be basic data type or constructor type. Therefore, Arrays can be divided into numeric arrays, character arrays, pointer arrays, Structured arrays, and other categories based on the types of array elements.

Stack)

Is a special linear table that can only be inserted and deleted at one end. It stores data according to the principle of "back-in-first-out". The data that comes first is pushed to the bottom of the stack, and the final data is placed at the top of the stack, data is popped up from the top of the stack when data needs to be read (the last data is read by the first one ).

Queue)

A special linear table that can be deleted only at the front of the table and inserted at the back end of the table (rear. The end of the insert operation is called the end of the team, and the end of the delete operation is called the head of the team. When there are no elements in a queue, it is called an empty queue.

It is a non-sequential storage structure of physical storage units. The logical sequence of data elements is achieved through the pointer link sequence in the linked list. A linked list consists of a series of nodes (each element in a linked list is called a node), which can be dynamically generated at runtime. Each node consists of two parts: one is the data domain that stores data elements, and the other is the pointer domain that stores the next node address.

Tree)

Is a collection K that contains n (n> 0) nodes, and defines a relationship N in k, n meets the following conditions:

(1) There is only one node K0. For relation N, there is no precursor. K0 is the root node of the tree. Root for short ). (2) Except for K0, each node in K has only one precursor for relation n.

(3) Each node in K can have m successor for relation n (m> = 0 ).

Graph)

A graph consists of a finite set V of a node and a set E of an edge. In order to distinguish it from the tree structure, the node is often called a vertex in the graph structure, and the edge is an ordered even pair of vertex. If there is an edge between two vertices, the two vertices are adjacent.

Heap)

In computer science, heap is a special tree-shaped data structure, with each node having a value. Generally, the data structure of a heap refers to a binary heap. Heap is characterized by the smallest (or largest) value of the root node, and the two subtree of the root node is also a heap.

Hash)

If a record with the same keyword and K exists in the structure, it must be stored at the location of F (k. Therefore, you can directly obtain the queried records without comparing them. The corresponding relationship F is called a hash function, and the table created based on this idea is a hash function.

Related Keywords:

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.