https://gateoverflow.in/840/gate2002-2-10
SUPPODE IN THIS QUESTION I TAKE A EXAMPLE LIKE
UNSORTED ARRAY 3 1 2 4
INDEX 0 1 2 3 and we need to find element x=4
NOW SUPPOSE I AM APPLY ABOVE ALGO let i=2 checking A[i] with x not matched
so go to step 1 again we choose any random i then suppose again unmatched
so my doubt is that how we are ensuring that i will be different in each iteration ...and scond doubt is that at each iteration the number of comparision is only one so how expected comparision is n