Question: Question 2 3 ( Mandatory ) ( 1 point ) Thirty ( 3 0 ) students registered for a field trip. When the bus arrives,
Question Mandatory point
Thirty 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.
tableAlgorithm Algorithm Repeat until the name is found or until,Let the current name be the first nameyou 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 thestudents 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 theIf the name in the list matches the,next name in the list.students 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 always finds the students name
Neither Algorithm A nor Algorithm B finds the students name.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
