The incomplete function shown below performs a linear search to find the position of the target item in the following array of strings - Scottish Highers Computing Science - Question 7 - 2018
Question 7
The incomplete function shown below performs a linear search to find the position of the target item in the following array of strings.
Meena
Sean
Gianni
Ali
Nyah
L... show full transcript
Worked Solution & Example Answer:The incomplete function shown below performs a linear search to find the position of the target item in the following array of strings - Scottish Highers Computing Science - Question 7 - 2018
Step 1
Line 8 SET
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
position to index
Step 2
Line 10 UNTIL <end of list> OR
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
target=list(position)
target = list(index)
position = index
Step 3
State the value that would be returned by the function if the target item was not in the list.
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
-1
Join the Scottish Highers students using SimpleStudy...