Introduction to Algorithms

  1. loop invariant
    1. initialization: it is true before the first iteration of the loop
    2. Hold: If it was true before one iteration of the loop, it is still true until the next iteration
    3. Termination: When the recycle terminates, the invariant provides us with a useful property that helps to prove that the algorithm is correct
  2. Conventions in Pseudocode
    1. Indentation indicates block structure
    2. to downto by
    3. If there is no special specification, the variables all represent local variables
    4. The property notation of an object uses concatenation, such as xyf

Guess you like

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