ALGORITHM: Linear Search 1.Set K : = 1 & loc : = 0 2.Repeat step 3 & 4 while loc : = 0 &k = 0 or If (item = data[k]) then Print “loc is the location of item” Else Print “no. not found” Exit Q: Run...


ALGORITHM:
Linear Search


     1.Set K : = 1 & loc : = 0


     2.Repeat step 3 & 4 while loc : = 0 &k < =="">


     3. If (item = data[k])


loc : = k


Else


K = k + 1



  1. If loc > = 0 or If (item = data[k]) then


Print “loc is the location of item”


Else


Print “no. not found”



  1. Exit



Q: Run the above algorithms A1 C++



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here