I\'m reading \"Introduction to Algorithm\" by CLRS. In chapter 2, the authors mention \"loop invariants\". What is a loop invariant?
In simple words, it is a LOOP condition that is true in every loop iteration:
for(int i=0; i<10; i++) { }
In this we can say state of i is i<10 and i>=0
i<10 and i>=0