Data Structure - Chapter 2. Learning Summary

Chapter Summary

First, the summary is shown in this chapter

 

Second, feelings and experiences

1. Complete the job or practice:

A start that he could not play the complete code, always missed it missed that, and always have to look at learning how to play, then kick or a textbook lesson in Mu still have problems after the entire code to run but could not find it looking for students to help, quite helpful. Code learn to play more and more multi-contrast codes themselves with others, then slowly on the familiar routine a bit, feeling a lot better.

Then I think, playing the code, the most important thing is understanding the problem, spend more time is worth, or is doing useful work. For example, the practice of 7-1 "zero polynomial output should be 00" 1 I did not understand well lead to code errors

2. Panel Discussion:

1) My two team members are really great (feel overwhelmed luck), to take them to learn.

The first group cooperation to fight the code did not feel that they do duty as a leader, a little unqualified sense, but also to redouble their efforts to improve their topic analysis, code logic, the ability to write code as well as group work. There are typing speed (laughs weep .jpg)

 

2) teacher recommended code, insert function to write really good concise (thumb .jpg)

Learned "in the body of the loop return means return from a called function to the calling function to continue, after the return of the function to the back end of the statement is not executed."

void InsertList (LinkList L &, int X) 
{ 
    LNode * P = L; 
     
    the while (! p-> Next = NULL) 
    { 
        // return means return from a called function to the calling function to continue, after the end of a return back to function statement is not executed 
        IF (p-> next-> Data == X) return ; // next node p at the node is equal to X 
        
         IF (p-> next-> Data> X) BREAK ; // p a junction point to the next node is greater than X 
         
        P = p-> next; 
    } 
    
    // insertion node s, which data field value X   
    LNode * = S new new LNode; 
    S -> data = X; 
             
    S-> = p-Next> Next; // When L is an empty list, p-> Next == NULL   
    p-> Next = S; 
    
}

 

3) peer review team found a lot of people do not quit before reclaim space in the program, it should do well to remember that he can not forget it next time

void DestroyList(LinkList L)
{//回收空间 
    LNode *p = L ;
    LNode *r ;
    while(p)
    {
        r = p->next ;
        delete(r) ;
        p = r ;
    }
}

 

Third, share

Double-linked list, circular list talking about relatively small, so look for a related blog, are interested can look: https://blog.csdn.net/u014799564/article/details/102920365

 

Fourth, the next goal:

Nothing more than to play the code, in order to truly learn the list; take some time to learn to preview the contents of the back, good to learn the next chapter. Efforts! Come on!

 

Guess you like

Origin www.cnblogs.com/Madge/p/12637904.html