Neco 2022 Computer Studies Question 34
Practice objective / multiple choice question 34 from the 2022 Neco Computer Studies examination.
Below is a pseudo‑code for a binary search on a sorted array A[1..10] looking for a target value T. ``` low = 1 high = 10 while low <= high mid = (low + high) / 2 if A[mid] = T then print "found" exit else if A[mid] < T then low = mid else high = mid print "not found" ``` Identify the logical error that can cause the loop to run indefinitely when T is absent, and state the corrected statements for updating `low` and `high`.
Answer Options
About This Question
This is Neco 2022 Computer Studies Question 34. It is one of the objective questions from the 2022 Neco Computer Studies examination.
Difficulty level: Medium .
Master the Exam!
You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.