Algorithm 1 Random Search
Input: An array AAA of size nnn and an element xxx
Output: The index of xxx in AAA or −1-1−1 if x∉Ax \notin Ax∈/A
1:Let PPP be an empty array of size nnn with all zeros.
2:c=0c = 0c=0
3:while c≠nc \ne nc=n do
4:i=i =i= Random(1,n1, n1,n)
5:if A[i]=xA[i] = xA[i]=x then
6:return iii
7:end if
8:if P[i]=0P[i] = 0P[i]=0 then
9:P[i]=1P[i] = 1P[i]=1
10:c=c+1c = c + 1c=c+1
11:end if
12:end while
13:return −1-1−1