20172322 2017-2018-2 "Program Design and Data Structure" Week 8 Learning Summary

20172322 2017-2018-2 "Program Design and Data Structure" Week 8 Learning Summary

Textbook learning content summary

  • This week, you learned about implementing polymorphism using interfaces and inheritance, respectively.
  • Inheritance implements polymorphism. For example, the Mammal class is the parent class of the Horse class, then a Mammal object can point to any Horse class object, such as the following code

    Mammal pet;
    Horse secretariat = new Horse();
    pet = secretariat;
  • Interfaces implement polymorphism, such as declaring an interface Speaker:

    public interface Speaker
    {
    public void speak();
    public void announce(String str);
    }
    The reference variable current can only be any object of any class that implements the Speaker interface.
  • Learned insertion sorting and selection sorting.
    • The basic method of selection sorting is to scan the entire sequence to find the minimum value, exchange the minimum value with the element in the first position, scan other elements except the first element again, find the minimum value and exchange it with the second value, Repeat this until the sorting is complete.
      - Example:
      3 1 9 3 6 2 10
      1 3 9 3 6 2 10
      1 2 3 9 6 3 10
      1 2 3 3 6 9 10
    • The insertion method is to compare the first number only with the number behind itself. If it is less than the number after it, it will not move, and if it is greater than the number, the position will be exchanged. After the comparison is completed, it will be compared with the first two numbers and the third number, according to the previous principle. Place the location.
      - Example:
      3 1 9 3 6 2 10
      1 3 9 3 6 2 10
      1 3 9 3 6 2 10
      1 3 3 9 6 2 10
      1 3 3 6 9 2 10
      1 2 3 3 6 9 10

Problems and Solving Processes in Teaching Materials Learning

  • There are not many problems with the textbook study this week.
  • Question 1: When I first started learning the insertion sort method, I mistakenly thought that when a number conforms to its rules, it is not a step and will be skipped directly.
  • Solution to problem 1: After Mr. Wang's explanation in the class, it was found that even if it complies with its sorting rules, it is counted as one step and has been scanned.

Problems and solutions in code debugging

  • Question 1: I encountered a problem while doing the homework PP10.5. After analyzing the requirements of the topic, I simply thought that the Movies class could be modified directly, which resulted in some errors that could not be sorted.
  • Solution to problem 1: Carefully read the Contact class in the book and compare it with the DVD class again, and found that the DVD class does not have the compareTo interface, and then wrote the interface according to the Contact class in the book.

code hosting

Summary of last week's exam mistakes

  • Wrong question 1 and the reason: I didn't read the book carefully, almost the original words in the book

  • Understanding: Although the original words in the book are like this, I still have a question, why is the efficiency N^2? According to their algorithm, their number of operations should be less than N^2 and should be N! , the efficiency should be higher than N^2.

Pairing and mutual evaluation

Review Template:

  • Worth learning or questions from the blog:
    • Fan Wenqi's blog textbook has a very detailed summary of the learning content. At first glance, you can tell that she has studied the content of the book very seriously.
    • Although the wrong part is relatively clear, I think it will waste some time to use the non-picture method. If you put it directly in the form of pictures, you may have more time to understand the problem.
  • Worth learning or problems in the code:
    • The explanation of the commit submission is clear and concise, which is a bit more concise than mine, but the expression of the meaning is actually similar. I think I should learn it to save time.
    • The code in this week's textbook and the code in the experiment are not placed in separate folders, which makes it difficult to find the code in the future. It is recommended that she place them separately.

Reviewed classmates blog and code

  • Pair study this week
    • 20172303

    • Pair learning content
      • Teach Fan Wenqi to use UML diagrams.
      • Fan Wenqi actively supported me when I encountered difficulties in writing PP9.1, which made me understand some of the difficulties in this chapter!

other

  • Comprehension: The main time this week was spent on four arithmetic projects. Fortunately, the content of this week's book is not difficult, and it is not difficult to learn, but this week is also the first time I realized the difficulty of compiling a project.

learning progress bar

Lines of code (added/accumulated) Blog volume (new/cumulative) Study time (added/accumulated) important growth
Target 5000 lines 30 articles 400 hours
the first week 242/242 1/4 13/13 Increased interest in Java
the second week 297/539 1/5 15/28 Finding your goals is not as hard as you think
The third week 315/854 2/7 18/46 Suddenly found that the difficulty of JAVA is not small
the fourth week 1269/2123 1/8 50/96 Java is hard to cry, but confident to beat him!
fifth week 737/2860 1/9 30/126 Difficulty reduction stimulates learning motivation
Week 6 542/3402 2/11 20/146 It can't be said that the difficulty has become less! ! ! It's hard again TT
Week 7 956/4357 1/12 35/181 simple is the best
eighth week 2448/6805 3/15 80/261 It takes too much time for the four operations. Fortunately, the code teacher of the example in the book gave it
  • Planned study time: 40 hours

  • Actual study time: 80 hours

  • Improvements: Based on the seniors' suggestions for last week's blog, I modified last week's blog, and tried to avoid similar problems in this week's blog

References

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325210337&siteId=291194637