Question: On entering the While loop for the first time, what is the value of Index? The following pseudocode used to perform a binary search of
On entering the While loop for the first time, what is the value of Index?
The following pseudocode used to perform a binary search of the names "Arnold", "Draper", "Gomez", "Johnson", "Smith", "Wong" (stored in Array), for the name "Gomez". (Assume the array and all the variables have already been declared with their appropriate data types.)

Set N = 5 Set Key "Gomez" Set Low Set High = N Set Index Int (N/2) Set Found While (Found == 0) AND (Low Array[Index] Then Set Low = Index + 1 Set Index = Int((High + Low)/2) End If If Key < Array[Index] Then Set High = Index - 1 Set Index = Int((High + Low)/2) End If End While
Step by Step Solution
3.55 Rating (176 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
