20172328 2018-2019 "Java software architecture and data Fundamentals" First week study summary

Source: Internet
Author: User

20172328 2018-2019 "Java software architecture and data structure" the first week of learning summary overview GeneralizationThis week, we learned about software quality, data structure, and algorithmic analysis, mainly based on the first and second chapters of the textbooks used. Summary of learning contents of textbook A Summary of textbook
  • Chapter One: Overview
  • 1.1 Software Quality
  • Software Engineering: A discipline of technology and theory on high-quality software development.
  • The goal of software engineering: Solving correctness problems, giving solutions on time and within budget, giving high-quality solutions, and accomplishing things in a reasonable manner.
  • Features of high-quality software

  • Important Interpretation:
  • Reliability: Reliable software rarely fails, and even if a failure occurs, the impact of the failure can be minimized.

  • About maintainability: Software systems must be carefully designed, coded, and documented to support the work of developers, maintainers, and users.

  • About portability: Java's source code is compiled into bytecode, which is a low-level language and is not a machine language for any particular CPU. The bytecode runs on the Java Virtual (JVM). The JVM is a software that interprets and executes bytecode.

  • For operational efficiency: software must efficiently use resources such as CPU time and storage .

  • 1.2 Data structures
  • Data structure: The form of computer storage and organization.
  • program = data structure + algorithm
  • Software = Program Plus software engineering
  • The Java Toolkit provides a powerful data structure. Common data structures are arrays, stacks, queues, linked lists (Linked list), Trees (tree), hash tables (hash), hash tables, and so on.
  • The stack reverses the structure of the data set, and the queue maintains the structure of the dataset.
  • Common data structures that can be used to queue a sequence set are sequential tables, heaps, and hash lists.

  • Chapter Two: Algorithm analysis
  • 2.1 Algorithm Efficiency analysis
  • Algorithm Analysis: The main focus of computer science on the efficiency of software algorithms. Algorithmic analysis is the basis of computer science.
  • 2.2 Growth function and Big O notation
  • Growth function: Represents the amount of time or space that corresponds to the size of the problem, representing the relationship between the size of the problem (n) and the value we want to optimize. This function represents the event complexity or spatial complexity of the algorithm.
  • Progressive complexity: called the order of the algorithm. As the example in the book, the second dish washing algorithm has the time complexity of order n^2, which is recorded as O (n^2), this notation is called O () or large O notation. The order of the algorithm is the constant and other minor items in the growth function that ignore the algorithm, and only the main items are retained .
  • Some growth functions and their progressive complexity [image display]
  • Thus, the order of the algorithm provides an upper bound for the growth function.
  • 2.3 Comparison of growth functions

  • Callout: √10≈3.162277660168379, 3√10≈2.1544, log? (=LG)/LG (2) =1/lg (2) = 3.321928, judging from the last set of data, the problem is not to speed up the CPU ( because the speed of the processor after the help is small poor ), but to simplify the problem on the algorithm, greatly improve the speed of the program run.
  • Comparison Chart of growth function

  • 2.4 Time complexity analysis
  • Analysis of complexity of 2.4.1 cycle operation
  • To analyze the order of an algorithm, it is often necessary to determine the number of times a particular statement and a set of statements run. To analyze a loop run, first determine the order n of the loop body, and then multiply it by the number of times that the loop runs. Remember, n is the size of the problem.
  • Even though the loop sometimes skips several numbers, the growth function changes, but the constant does not affect the asymptotic complexity, so the order is unchanged.
  • Analysis of complexity of nested loops in 2.4.2
  • When parsing nested loops, both the memory loop and the outer loop are taken into account, and the complexity is calculated using multiplication.
  • The complexity of the method invocation is related to the complexity of the loop body.

Problems in teaching materials learning and the solving process Problem and countermeasure
    • Question: In the Teacher class exam questions, always feel that the number of runs is n (n-1), so the complexity should be expressed as O (n (n-1)), but at that time in the book instance did not see this expression, first did the problem, but did not understand.
    • Solution: In fact, this problem is not a serious reading of the consequences. There is such a passage under Book page 15:

      In this case, the inner Loop index is initialized to the current value of the outer loop index. The outer loop runs n times, the inner loop is executed n times for the first time, the second executes n-1 times, and so on. Remember, however, that we are only interested in the item and ignore the other constant or any other minor items. If the complexity is linear, the order is still O (n) regardless of the number of elements, so the complexity of the above code is O (n^2).

After-school exercises answer Exercise
    • EX 2.1: What is the order of the following growth functions?
      • a.10n^2+100n+1000
      • Answer: Order is: n^2.
      • B.10n^3-7
      • Answer: Order: n^3
      • C.2^n+100n^3
      • Answer: Order: n^3
      • D.n^2 log (N)
      • Answer: Order: n^2 log (n)
    • EX 2.4: Please determine the growth function and order of the code snippet below
for(int count = 0 ; count < n ; count++)    for(int count2 = 0 ; count2 < n ; count2 = count2 + 2)        {            System.out.println(count,count2);        }}
    • Answer: The number of times required by the internal loop is N/2, the number of times the outer loop needs to be performed is n, so the growth function is f (n) = (n^2)/2, order is n^2
    • EX 2.5: Please determine the growth function and order of the code snippet below
for(int count = 0 ; count < n ; count++)    for(int count2 = 1 ; count2 < n ; count2 = count2 * 2)        {            System.out.println(count,count2);        }}
    • Answer: The number of times the internal loop is log? (n-1), the number of times the outer loop needs to be performed is n, so the growth function is f (n) =n log? (n-1), and because the order is related to the highest order of the growth function, the order is n log2 (n) to omit the secondary and constant entries.
Pairing and mutual evaluation Group Estimate

-20172301
-20172304

Reviews Template:
    • Blogs that are worth learning or questions:
      • 20172301:
      • 20172304:
Other (sentiment, thinking, etc., optional) Else

Do not listen to the sound of the forest dozen leaves, why not chant and Xu line.

Learning progress Bar Learning List
lines of code (new/cumulative) Blog Volume (Add/accumulate) Learning Time (new/cumulative)
Goal 5000 rows 30 Articles 400 hours
First week 0/0 1/1 8/8
Resources Reference
    • [Java software architecture and data Structure] (fourth edition)
    • Types of Java Data structures

20172328 2018-2019 "Java software architecture and data Fundamentals" First week study summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.