Answer to Question #277797 in Algorithms for hash

Question #277797
  1. The following names of students are stored in an array with the identifier studentnames. studentnames = ["Rob", "Anna", "Huw", "Emma", "Patrice", "Iqbal"] Describe the steps that a linear search would take to find Anna in studentnames
1
Expert's answer
2021-12-09T10:12:39-0500
Start
  Declare array studentnames = ["Rob", "Anna", "Huw", "Emma", "Patrice", "Iqbal"] 
  for i =0 to 5 do
       if studentnames[i]="Anna" then   
             Dispay name
             Exit for
       end if
  End for  
Stop
Step 1: index =0, name ="Rob"
Step 2: index =1, name ="Anna"

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS