Question: Question 2 3 ( Mandatory ) ( 1 point ) Thirty ( 3 0 ) students registered for a field trip. When the bus arrives,

Question 23(Mandatory)(1 point)
Thirty (30) students registered for a field trip. When the bus arrives, the students randomly line up to board the bus, but their teacher needs to take attendance using a list containing the students names. The student names are in alphabetical order by last name. Two different algorithms are given for finding each student's name as they board the bus.
\table[[Algorithm 1,Algorithm 2],[Repeat until the name is found or until,Let the current name be the first name],[you run out of names in the list:,on the list.],[Repeat until you find the name in the list,],[Look at the middle name in the list,or reach the end of the list.],[If the name in the list is too high,,If the current name matches the],[student's name,],[Cut off the top half of the list.,Mark the student present and stop.],[If the name in the list is too low,,],[Cut off the bottom half of the list.,Otherwise, make the current name the],[If the name in the list matches the,next name in the list.],[student's name,,],[Mark the student present.,]]
Algorithm A always finds the student's name, but Algorithm B does not.
Algorithm B always finds the student's name, but Algorithm A does not.
Both Algorithm A and B always finds the students name
Neither Algorithm A nor Algorithm B finds the students name.
 Question 23(Mandatory)(1 point) Thirty (30) students registered for a field trip.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!