[Soft test] Introduction to Data Structure

Source: Internet
Author: User
Tags knowledge base

The data structure is the Set (or data object) of the data element and the relationship and constructor between the elements. The relationship between elements is the logical structure of data. The storage format of the relationship between data elements and elements becomes the storage structure. Learning the data structure helps you select an appropriate logical structure, storage structure, and corresponding operation methods for the data designed by the application. This improves the efficiency of solving computer problems.

Research Focus

1. The logical structure of data and storage of various types.

2 Data Operations: search and sort

Knowledge Overview

(Click here to view the big picture)

Vertical and horizontal comparison

1. Data is divided into line trees by logical structure. What are the differences between the three?


Line one parent and one child

Tree A parent n Children (n = 1, 2, 3 ..)

Figure M parent n Children (n, m = 1, 2, 3 ..)

In summary, lines and trees are a special graph.

2. What are the differences between data storage and sequential storage and chained storage?

Sequential storage is a sequential storage unit with a group of addresses. Five people go to the classroom and sit in a row of seats. (Assume that the boss is number 1 and the second is number 2 .) Once someone wants to insert it between the old and the second, they can only move it from the second to the old five. Because sequential storage is related to the actual address.

Chained storage does not require address continuity. Nodes are used for storage. Includes data domains and pointer domains. The data field stores elements, and the pointer stores the next address connected to it. If you are a newbie, you can just change the pointer of the newbie and the newbie. Others will not be affected.

3. What is the difference between stack and queue storage in sequence?

First, the same point is stored with continuous addresses. The difference is:

Sequential StackGenerally, a one-dimensional array and a variable at the top of the record Stack are used to store stacks in sequence. Common Operations are Stack entry and stack exit. Before stack entry, check whether the stack is full.

Ordered queue: There are three fields, Data, front, and rear. Two Value assignment statements are used for inbound queue operations. Sq. Front = SQ. Front + 1; sq. Data [sq. Rear] = x complete.

4. What are the relationships and differences between stacks, queues, and binary trees that adopt chained storage??

First of all, pointers are used in common.

Chain Stack(Method 1) using a single-chain table of the leading node. Assume that ls points to the head node of the linked list, the first node is the top node of the stack, and LS-> next points to the top node of the stack.

Chain queue: Use a single-chain table of the leading node. The header Pointer Points to the head node of the linked list, And the next field of the head node of the single-linked table executes the first node of the queue.

That's right. The above two sentences mean one thing... However, because binary trees generally have two subnodes, there are also some differences in storage.

Binary Tree: Take the binary linked list as an example. In the binary linked list, data is stored, and the pointer field that stores data pointing to the left and right children.


Data Representation and data processing are indispensable for solving any practical problems with computers. one of the core problems of data representation and processing is data structure and implementation. This is the basic content of our data structure. Of course, it also provides the necessary knowledge base for our database and its applications, operating systems and other courses. At the same time, we must be aware that many algorithms are limited by storage methods. All data storage should be prioritized. This part of content has a clear framework, but the knowledge points should be well summarized.

Learning continues. The summary is constantly updated. We welcome criticism and correction.

[Soft test] Introduction to Data Structure

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.