- loop invariant
- initialization: it is true before the first iteration of the loop
- Hold: If it was true before one iteration of the loop, it is still true until the next iteration
- Termination: When the recycle terminates, the invariant provides us with a useful property that helps to prove that the algorithm is correct
- Conventions in Pseudocode
- Indentation indicates block structure
- to downto by
- If there is no special specification, the variables all represent local variables
- The property notation of an object uses concatenation, such as xyf
Introduction to Algorithms
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325955178&siteId=291194637
Ranking