Data is the result of observation, experiment, or calculation. There are many types of data, the simplest of which is numbers. Data can also be text, images, sounds, etc. Data can be used for scientific research, design, verification, and so on. Structure, the overall composition of the various parts of the collocation and arrangement, the two perfect combination, we need to re-understand her, her
Data is the result of observation, experiment, or calculation. There are many types of data, the simplest of which is numbers. Data can also be text, images, sounds, etc. Data can be used for scientific research, design, verification, and so on. Structure, the overall composition of the various parts of the collocation and arrangement, the two perfect combination, we need to re-understand her, her
The data is the value, that is, the result we get through observation, experiment, or calculation. There are many types of data, the simplest of which is numbers. Data can also be text, images, sounds, etc. Data can be used for scientific research, design, verification, and so on. Structure, the overall composition of the various parts of the collocation and arrangement, the two perfect combination, we need to re-understand her, re-examine and define her: data structure is an important theoretical and technical basis for program design. The content and technology she discussed play an important role in the development of software projects. By studying the data structure, we learn to analyze and study the characteristics of data processed by computers from the perspective of problems, so that appropriate logical structures, storage structures, and corresponding operation methods can be mounted to the data designed for applications, to improve the efficiency of application computers in solving problems.
I have been studying the xicai video for a while. In this period of time, self-testing and rank-based tests are mixed. to exaggerate, there are laughter and tears, I laughed at the fact that the two major questions that I got from the grade test yesterday were all original questions. The tears were that there was a blank question and a return question, and I remembered that sentence, it is always necessary to wait for the exam to know that the book to be read has not been read. There are a total of 60 points for the big question. If the Score System in previous years is used, it will take 60% of the total score, that is to say, 60 points should be scored points, but I can only get points for the last question, you can repeat C ++ '(* partition _ partition *)'. Today, I want to explain the data table in the data structure. First, let's take a look at a diagram of the basic data structure:
After learning about the basic data structure, go to the topic linear table today. This blog article focuses on the following:
I. Linear table <喎?http: www.2cto.com kf ware vc " target="_blank" class="keylink"> Container + ICAgIDxzdHJvbmc + container/f0NSx7crH1 + container/mxvrLZ1/container + s/container + z9/container + o6zI58/CzbzL + cq + o7o8L3A + Container = "http://www.2cto.com/uploadfile/Collfiles/20140923/2014092309223650.png" alt = "\">
Sequence Structure: sequence structure is the simplest program structure and the most common program structure. You only need to write the corresponding statements in the order of solving the problem. The execution sequence is from top to bottom, in turn. For a simple example, a = 3, B = 5, and now the values of a and B are exchanged. This problem is like switching two cups of water. Of course, the third cup is used, if the third cup is c, the correct program is: c = a; a = B; B = c; the execution result is a = 5, B = c = 3.
Linked List, As shown in:
Linked List: A linked list is a non-continuous and non-sequential storage structure of physical storage units. The logical sequence of data elements is achieved through the pointer links 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. Compared with the sequential structure of a linear table, the operation is complex.
Category of linked list: Single-chain table, cyclic linked list, and double-chain table. As shown in:
Data Field: stores data; pointer field: stores the address pointing to the next node; Circular linked list: the last node. Her next node is the first node.
Double-linked table: There are two pointer fields that link the linked list from two different directions. A double-linked table can be moved in two directions. A single-linked table moves in one direction. The flexibility of a double-linked table is better than that of a single-linked table. Double-linked tables are more expensive because they have two pointer fields.Deletion and insertion of single and double linked lists: Delete a single-chain table: delete a node. Delete a2. Method: Direct the a1 pointer field to a3. Skip a2. Then a2 is deleted from the linked list, another task is to release a2. Point the next field of the forward node to be deleted to its next node. Insertion of a single-chain table: deleting a node directs the forward order to the back order. inserting a node is a reverse process, where a new node is inserted, point the next field of her forward node to the newly added node, and then point the next field of the newly added node to the next node. Double-chain table deletion and insertion: two aspects are involved: from left to right columns and from right to left columns. It is not a simple chain, but a chain is completed, we need to write out all four steps, complete the first steps of the two operations first, and then proceed to the second step.Sequence Table PK linked list
Ii. Queue
Concept: A queue is a special linear table. It can only be deleted at the front end of the table, but 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. For example, if you go to the canteen to queue up, you can buy food first, and the team tails come later. When you enter the station, you can check your luggage first, and then you can go in later.
CategoryA queue is a special linear table. It allows you to delete only the front of a table, the insert operation on the table's backend (rear) is similar to the stack, and the queue is a linear table with limited operations. 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. In a data structure such as a queue, the first element to be inserted will be the first element to be deleted; the last element to be inserted will be the last element to be deleted, therefore, a queue is also called a linear table of "FIFO-first in first out. For example:
Ordered queue:
Cyclic queue:
Ps: the word "Yes" is wrong. Don't laugh.
Iii. Stack
STACK: it is not a real concept. It is a logical concept, an idea, or an idea. Unlike chain storage and sequential storage, it is a node and has a regular pattern, it is based on sequential storage and chained storage, and is a logical concept. Stacks can be implemented either in a chained structure or in an ordered structure-an array. Define a rule first and then go out. As follows:
Note:A linear table (also called a sequence table) is the most basic, simple, and commonly used data structure. The relationship between data elements in a linear table is one-to-one, that is, except the first and last data elements, other data elements are connected at the beginning and end. The logical structure of a linear table is simple for implementation and operation. Therefore, the linear table data structure is widely used in practical applications. The stack and queue are a special linear table. The road to the soft test is to be continued ......