Photo AI

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 icon

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-Scottish Highers Computing Science-Question 7-2018.png

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

Answer

position to index

Step 2

Line 10 UNTIL <end of list> OR

99%

104 rated

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

Answer

-1

Join the Scottish Highers students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;