Question 25(c)(i) 2013 · October-November · Paper 33 · 1 mark
Question 25
Part (c)
(i)
Question 25
passed_theory_test(X) AND passed_driving_test(X, V). These clauses have the following meaning: Clause Explanation
Question 1
The minimum age for a car licence is 18
Question 8
Shen is aged 21
Question 13
Tain has a licence Person X is able to drive vehicle V if person X has a
Question 15
licence, and the age A of person X is greater than or equal to the minimum age L to drive vehicle V
Question 11
Part (c)
Write a clause to output:
(i)
What condition is put on the BookTitle array contents for a binary search to be
used?
The following is a recursive function for the binary search algorithm. FUNCTION BinarySearch(ThisArray, FindValue, Low, High) : INTEGER IF High < Low THEN RETURN -1 // not found ELSE Middle ← INT((High + Low) / 2) IF ThisArray[Middle] > FindValue THEN BinarySearch(ThisArray, FindValue, Low, Middle – 1) ELSE IF ThisArray[Middle] < FindValue THEN BinarySearch(ThisArray, FindValue, Middle + 1, High) ELSE RETURN Middle // found ENDIF ENDIF ENDIF ENDFUNCTION
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Why this question appears here
98% assigned-topic match · Computational thinking and problem-solving › Recursion
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9691_w13_qp_33.pdf
