4. Consider the following list of numbers 5, 12, 25, 32, 38, 46, 58, 62, 85, 90
ID: 3881104 • Letter: 4
Question
4. Consider the following list of numbers 5, 12, 25, 32, 38, 46, 58, 62, 85, 90 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 Iteration first last list mid] Number of comparisons mid Iteration first last mid list (mid] Number of comparisons e. 37 Iteration Hrst list(mid) Number of comparisons last midExplanation / Answer
a) 66
Iteration
first
last
mid
List[mid]
Number of comparisons
1
0
12
6
58
0
2
7
12
9
90
2
3
7
8
7
62
4
4
8
8
8
85
6
b) 11
Iteration
first
last
mid
List[mid]
Number of comparisons
1
0
12
6
58
0
2
0
5
2
25
2
3
0
1
0
5
4
4
1
1
1
12
6
c) 37
Iteration
first
last
mid
List[mid]
Number of comparisons
1
0
12
6
58
0
2
0
5
2
25
2
3
3
5
4
38
4
4
3
3
3
32
6
d) 90
Iteration
first
last
mid
List[mid]
Number of comparisons
1
0
12
6
58
0
2
7
12
9
90
2
Iteration
first
last
mid
List[mid]
Number of comparisons
1
0
12
6
58
0
2
7
12
9
90
2
3
7
8
7
62
4
4
8
8
8
85
6
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.