Data Structure Chapter 2 Summary

The second chapter officially started the course of learning data structure. This difficulty is really unfriendly. Even though the linear table in chapter 2 is the basic part of the whole tutorial, it will be much more complicated to learn than to simply code. We think more than how to write the functions I need in C ++, but more focus on a lower-level understanding of this data structure, and build algorithms on this basis.

The following is a review in subsections:

2.1 Definition and characteristics of linear table: From the definition point of view, it is easy to think of the array and linked list of the last semester

2.2 Case introduction: Combine the characteristics of linear table to analyze the operation of unary polynomial and sparse polynomial (the main description used here is text, and there is no specific code)

2.3 Type definition of linear table: Based on the definition and characteristics of linear table, basic operations including access, insertion, and deletion are given (note the description below p22, you can also refer to these four points when giving other data structures in the future)

2.4 Sequential representation and implementation of linear tables: It is natural to associate with arrays here. The logically adjacent data elements are also adjacent in physical order, which can achieve random access. When defining a structure, you can use the pointer on the book (requires space) or the array on mooc (requires length determination)

The search time complexity of the sequence table is only O (1), but O (1) is required when deleting and inserting (see the description of the sequence table in p29)

* 2.5 Chained representation and implementation of linear table: The linked list is formed by nodes connected in series, and the nodes include data field and pointer field. Analyze the difference between the definition and basic operations of singly linked lists, circular linked lists, and doubly linked lists. The presence or absence of head and tail nodes will also affect the implementation of subsequent operations (so focus on this part of the textbook p29-p40)

2.6 Comparison of sequence table and linked list: Space: The storage density of the sequence table is large, so the sequence table time is generally used when the length is known and relatively small: the sequence table can achieve random access, but the time complexity of insert and delete operations is higher than the chain Table (chained tables are preferred when such operations are frequently required)

2.7 Application of linear table: order table / linked table order table merge (definition of intermediate nodes must be released in time)

* 2.8 Case analysis and implementation: here can be seen together with 2.2, 2.2 will implement the idea 2.8, each line of code needs to be carefully considered, and may be used in the future

* 2.9 Summary: Reading Books Reading Books

I have n’t imagined how difficult the data structure is before, but now I understand a little bit, so, I must read more books and code and write clear comments!

// *: need to return to textbook for review

Guess you like

Origin www.cnblogs.com/cmlearning/p/12683504.html