Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. Consider the following list of numbers 5, 12, 25, 32, 38, 46, 58, 62, 85, 9,

ID: 3881052 • Letter: 4

Question

4. Consider the following list of numbers 5, 12, 25, 32, 38, 46, 58, 62, 85, 9, 97, 105, 110 For each value below, assume you are using binary search to try to find whether the item in the list. For each iteration of the algorithm, fill in a line of the table. Refer to the examples on pp. 1272-1273 of your text book. Note. You may not need all rows of the table. a. 66 IterationSt East mid 1ist [mid] Number of Iteration first last mid list[mid] Number of c. 37 first ist (mid] Number of comparisons Iteration last d. 90 Iterationn first last mid list (mid) Number of comparisons

Explanation / Answer

a)66

element not found and four comparisions

b)11

element not found and four comparisions

C)37

Element not found and four comparsion.

d)90

Element found at 2nd comparsion.

Iteration first last mid list[mid] Number of Comparisons 1st 5 110 58 58 one 2nd 62 110 90 90 two 3rd 62 90 85 85 third 4th 62 62 62 62 fourth
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote