7 ms·
Is there a list of loop invariants for algorithms that are frequently used in interviews?
by raincom 8y ago
Is there a list of loop invariants for algorithms that are frequently used in interviews?
- 0x8BADF00D 8y agoNot 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.