Shortcut for chapter specific information

Wednesday, April 6, 2011

Loop Invariant

I start to learn what a loop invariant is and I wish I learned it long time ago.   It is a good habit to always think like this so that one can *prove* one is doing the right thing.

Intuition can help but it will fail when situation is complicated.  Besides, a loop invariant type of thinking can simply the loop and make it short.  (I like short program a lot.)

No comments:

Post a Comment