3 ms·
Not sure what you mean by your comment. You can use loop invariants when solving problems that call for an iterative solution.
by 0x8BADF00D 8y ago
Not sure what you mean by your comment. You can use loop invariants when solving problems that call for an iterative solution.
- jonsen 8y ago“Can you write code to reverse a linked list in place?” “Sure, I’ll just implemment a loop according to this invariant ... “ Would be nice to have the invariant ready then.
- raincom 8y agoLoop variants for popular problems and popular algorithms to solve problems. This can give us inductive way of looking various problems. And classify problems/algos based on invariants.