question 1describe the binary search algorithm


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

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: question 1describe the binary search algorithm
Reference No:- TGS0359478

Expected delivery within 24 Hours