Data Structure-Chapter 2 Summary

1. Summary of the study of this chapter:

  The second chapter is significantly more difficult than the first chapter. This chapter is mainly about the operation of linear tables. The linear relationship of the linear table has two different storage structures: sequential storage structure (sequential table) and chain storage structure (linked list). In this chapter, we have practiced more on the linear storage structure of linear tables. The sequence table gives me the same feeling as the array. The mind map of this chapter is as follows:

 

Second, the experience when completing homework or practice:

This chapter began to write code to achieve operation

1. Discussion:

The discussion in this chapter is significantly more difficult than the previous chapter. These discussion questions help us understand linear tables, especially the nodes, pointer fields, and data fields at the beginning. I do n’t understand these basic things. You can't do it.

2. Group discussion:

There were two group discussions in this chapter. As the group leader, I knew that I had not fulfilled the responsibility of the group leader. Both team members are great! Keep going! We must also strengthen our ability to see the code, analyze the code, and type the code, and arrange the discussion methods more reasonably.

During the mutual evaluation, you can also see a lot of great code and learn a lot!

3. Homework:

The completion of the homework is still bumping, forget this, forget it, wrong or wrong, still have to turn the book when writing code, look at Mu class.

4. Often forget to release the linked list!

void DestroyList (LinkList L) 
{ // Release the recycling list space 
    LNode * p = L; 
    LNode * q;
     while (p-> next! = NULL) 
    { 
        q = p-> next;
         delete (p); 
        p = q; 
    } 
}

5. Definition of head and tail node structure type

typedef struct node
{
    ElemType data;
    struct node *next;
}LNode;

typedef struct
{
    LNode *head;
    LNode *tail;
}List;

void init(List &M)
{//初始化单链表 
    M.head = new LNode;
    M.tail = new LNode;
    M.head->next = NULL;
}

 

Third, share information

Because the circular list doubly linked list and put less, the recommended  basic operation cycle chain  and  the basic operation of a doubly linked list  , both blog posts very detailed, which involves malloc function, you can look at this blog post  malloc function usage

 

Fourth, the next goal

1. Follow the steps and learn Chapter 3

2. Continue to consolidate the linear table

3. Multi-code

Guess you like

Origin www.cnblogs.com/WSHBZ/p/12685077.html