As seen on Introduction to Algorithms (http://mitpress.mit.edu/algorithms), the exercise states the following:
Input: Array A[1..n]
and a v
In the case of linear search, the loop variant will be the backing store used for saving the index(output) .
Lets name the backing store as index which is initially set to NIL.The loop variant should be in accordance with three conditions :
.