Introduction to Data Structure Learning Points

Overview

This chapter introduces the basic concepts of data structures and algorithms, as well as the basic methods of algorithm analysis, which are the basis for learning the subsequent chapters. The organizational structure of the knowledge points in this chapter is shown in the figure below:
Insert picture description here

Key points/difficulties/points

The focus of this chapter is :

  1. Basic concepts of data structure;
  2. The logical structure of data, storage structure and the relationship between the two;
  3. Algorithms and characteristics;
  4. The representation of the big 0 mark.

The difficulty of this chapter is :

  1. Definition and use of abstract data types;
  2. Algorithm time complexity analysis.

This chapter will grasp two main lines. One main line is data structure, including the research object of data structure and related concepts, and the other main line is algorithm, including algorithm related concepts, description methods and time complexity analysis methods.
In the data structure part , start with the problem solving process and understand "data structure + algorithm = program"; pay attention to the relationship between data structure and program design. The core concept of the data structure part is the data element, pay attention to the relationship between the data elements through specific examples; the important concept of the data structure part is the data structure, we must grasp two aspects: logical structure and storage structure, and pay attention to grasp the two The relationship between.
In the algorithm part , the concept and characteristics of the algorithm should be the basic points, and the characteristics of the application algorithm should be paid attention to in the future teaching. Don't learn the concept in isolation, pay attention to the extension and application of the concept; for the analysis of algorithm time performance, pay attention Focusing on the growth rate, that is, the order of magnitude of the number of executions of the basic statement, three key points are emphasized: basic statement, number of executions, and order of magnitude. The result of algorithm time performance analysis is the order of magnitude represented by big O notation.
Finally, it is emphasized that data structure and algorithm analysis are all aimed at large amounts of data, that is, the organization of large amounts of data and the processing efficiency of large amounts of data. With the increase in computer computing speed, the demand for fast programs that can handle large amounts of data has also become stronger.

Knowledge points

  1. The general process of program design is "question → idea → algorithm → program", and its essence is data representation and data processing. The main task of data representation is to abstract the data model from the problem and convert the model from the external representation of the computer to the internal representation of the computer; the main task of data processing is to abstract description of the problem-solving method, that is, to design the algorithm.
  2. Data structure is the subject of studying the operating objects of computers in non-numerical problems and their relationships and operations.
  3. Data element is the basic unit of data, which is usually considered and processed as a whole in computer programs. The data element is the smallest data unit involved in discussing the data structure, and the data item is generally not considered.
  4. Data structure refers to a collection of data elements that have a certain relationship with each other. According to different viewpoints, data structure is divided into logical structure and storage structure. The logical structure of data refers to the overall logical relationship between data elements, and the storage structure of data is the representation of data and its logical structure in a computer.
  5. According to the different logical relationships between data elements, data structures are divided into four categories: collections, linear structures, tree structures, and graph structures.
  6. Data structure usually has two storage methods: sequential storage structure and linked storage structure.
  7. An abstract data type is a general term for a data model (that is, a data structure) and a set of operations defined on the structure.
  8. An algorithm is a description of the steps to solve a specific problem, a finite sequence of instructions. Algorithms must meet the following five important characteristics: input, output, finiteness, certainty, and feasibility.
  9. In addition to satisfying the five major characteristics of the algorithm, a "good" algorithm also has the following characteristics: correctness, robustness, simplicity, abstraction classification, high efficiency, etc.
  10. Commonly used methods for describing algorithms include natural language, flowcharts, programming languages, and pseudo-codes. Among them, pseudo-code is a more appropriate method of describing algorithms and is called "algorithm language" or "first language".
  11. There are two methods to measure the efficiency of an algorithm: post-statistical methods and pre-analysis and estimation methods.
  12. Leaving aside the factors related to computer software and hardware, the most important factor affecting the time cost of the algorithm is the problem scale. The problem scale refers to the amount of input. Generally speaking, it can be obtained from the problem description.
  13. In order to objectively reflect the execution time of an algorithm, the number of executions of the basic sentences in the algorithm can be used to measure the workload of the algorithm. The basic statement is a statement whose execution times are proportional to the execution times of the entire algorithm.
  14. Time complexity is usually represented by big O notation, this method is actually an estimation method.
  15. The easy way to solve the time complexity of the algorithm is to find the sentence with the most execution times among all the sentences as the basic sentence, calculate the order of magnitude of the execution times of the basic sentence and put it into the big O notation.

Exercise

Problem abstraction and programming
The way to communicate effectively between humans and computers is (A).
A. Program B. Language C. Statement D. Algorithm
The key to program design is (C).
A. Data structure and algorithm B. Data representation and data processing CA and B are
all about the data organization and processing of all issues discussed in this course. (×)
The thinking used in the program design process is (D).
A. Logical thinking B. Abstract thinking C. Image thinking D. Computational thinking

Basic concepts of data structure The
logical structure has nothing to do with the content and form of the data element itself. (√)
The realization of basic operations based on a certain logical structure is unique. (×) In
theory, the storage structure has nothing to do with the programming language. (×)
The focus when discussing data structure is (B).
A. Data B. Data element C. Data object D. Data item
The data processed by the compiler is (C).
A. Language B. Statement C. Source program D. String
According to different viewpoints, the data structure is divided into logical structure and storage structure, and the viewpoint refers to (A).
A. Memory B. External storage C. File D. Problem

Basic concepts of algorithms
Flowcharts are the most commonly used method of describing algorithms. (×)
Like programming languages, pseudocode also has international standards. (×)
The determinism of the algorithm requires that for the same input, the same output will be obtained. (√) The
algorithm must satisfy the correctness, otherwise there is no value of existence. (×)
(D) is called "algorithm language".
A. Natural language B. Flow chart C. Programming language D. Pseudo code

Algorithm analysis
The time complexity of the algorithm is determined by the number of executions of the basic sentences in the algorithm. (×)
The time complexity of the algorithm is an accurate calculation of the resources consumed by the algorithm. (×)
The space complexity of an algorithm refers to the space occupied by input/output data and the auxiliary space for executing the algorithm. (×) In
-situ algorithm or in-situ algorithm means that the algorithm does not require auxiliary space during execution. (×) In the
following program segment, the problem scale is (H), the basic sentence is (C), and the time complexity is (G).
A.(1)
B.(2)
C.(3)
D.(4)
EO( n 2 n^2n2)
F.O( M 2 M^2 M2)
G.O(m×n)
H.O(m×n/2)

(1)for(i=0;i<m;i++)
{
    
    
(2)	for(j=0;j<n/2;j++)
(3)		cout<<data[i][j]; 
(4)	cout<<endl;
}

Reference: "Data Structure (From Concept to C++ Implementation)" Tsinghua University Press, Wang Hongmei

Guess you like

Origin blog.csdn.net/oldmao_2001/article/details/109045357