全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Loop invariant?

Definition 16.3 High School Computer Science · 第 16 章 — Proving Algorithms Correct

A loop invariant is a statement about the variables that is true before the first turn of a loop and that each turn keeps true: if it holds at the start of a turn, it holds at the end.

在原文中阅读 →
Definition 12.3 University Computer Science — Year 1 · 第 12 章 — Program Correctness

A loop invariant is a condition on the variables of a loop that holds before the first test of the loop condition and is preserved by each iteration: if it holds and the loop condition is true before an iteration, it holds after it. It therefore holds at every test, and in particular when the loop exits.

在原文中阅读 →