7. Consider the binary search algorithm as outlined in class. (You must use this exact version of...
Fantastic news! We've Found the answer you've been seeking!
Question:
7. Consider the binary search algorithm as outlined in class. (You must use this exact version of the binary search algorithm):
a) List the values that 44 would be compared to in a search for 44 in the following sequence: (1, 7, 9, 13, 15, 44, 57, 88).
Make sure to include the final value in the “equality” check as well.
b) List the values that 103 would be compared to in a search for 103 in the following sequence: (3, 8, 17, 21, 44, 73, 88,101, 113). Make sure to include the final value in the “equality” check as well.
8. Prove or disprove the following statements.
a) ⌊2x⌋= ⌊x⌋+ ⌊x + 0.5⌋, for all x ∈R.
b) x3 + x2+ log(x) is O(x3). (If you choose to prove this statement, you must do so using witnesses).
Related Book For
Posted Date: