QUESTION 1
Describe the binary search algorithm using an example of your own.
QUESTION 2
(a) By showing all your workings, give a big-O estimate for
f(x) = (x + 1)log(x3 + 1) + 3x2
(b) Calculate the time complexity of the following algorithm based on the number of comparisons only.
For i = 2 to n
If x > y then
Print y
End
For j = 2 to n
If z > j then
Print z
End
For k = 2 to n
If w > k then
Print w
End
End
End
End