Question: JAVA Search1(A, x) loc 0 while loc loc loc + 1 endwhile if(loc==A.length) loc -1 else int temp A[loc-1] A[loc-1] A[loc] A[loc] temp loc loc-1
JAVA
Search1(A, x)
loc 0
while loc
loc loc + 1
endwhile
if(loc==A.length)
loc -1
else
int temp A[loc-1]
A[loc-1] A[loc]
A[loc] temp
loc loc-1
endif
return loc
endalg
Step through the pseudo code when it is applied to the following array

13 17 23 28 31 38 (i) With the value x assigned to 17 (ii)With the value x assigned to 37
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
