码迷,mamicode.com
首页 > 其他好文 > 详细

Always review

时间:2016-08-28 06:28:12      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

Data structures

A data structure is a way to store and organize data in order to facilitate access and modifications.

Loop invariants

We use loop invariants to help us understand why an algorithm is correct. We must show three things about a loop invariant:

Initialization: It is true prior to the first iteration of the loop.

Maintenance: If it is true before an iteration of the loop, it remains true before the next iteration.

Termination: When the loop terminates, the invariant gives us a useful property that helps show that the algorithm is correct.

Always review

标签:

原文地址:http://www.cnblogs.com/Patt/p/5814221.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!