3.9 Developing Algorithms

5 阅读1分钟

1. Exam Points

  • Represent Algorithms
    • natural language
    • flowchart
    • pseudocode
    • programming language
  • Compare Algorithms
  • Predict the result or behavior of algorithms.

2. Knowledge Points

(1) Developing Algorithms

  • The way statements are sequenced and combined in a program determines the computed result.
  • Algorithms that appear similar can yield different results.
    • Example:
      image.png image.png
  • Programs incorporate iteration and selection constructs to represent repetition and make decisions to handle varied input values.
    • Example:
      image.png
  • Algorithms can be written in different ways and still accomplish the same tasks.
    • Example:
      image.png image.png
  • Algorithms can be newly created from an idea, by combining existing algorithms, or by modifying existing algorithms.
  • Using existing correct algorithms as building blocks for constructing another algorithm has benefits such as reducing development time, reducing testing, and simplifying the identification of errors.

3. Exercises