Shailendra B. answered 03/21/19
Tutor
4.9
(105)
Technical Leader with 23 years software experience
Invariant is generally used in the context of loops and you will hear the term "loop invariant". Loop invariant means its value is not going to change inside the loop so its more efficient to do its computation/calculation once before entering the loop.