Question: 1. (a) Express the function f(n) = 2n^3 + n^2 10n + 3 in terms of -notation. 2. (a) Given an array A of n

1. (a) Express the function f(n) = 2n^3 + n^2 10n + 3 in terms of -notation.

2. (a) Given an array A of n numbers, write down the binary search algorithm BinSearch (A, n, key) to determine whether there is a number in A that is equal to key. Assume that array A is sorted in non-decreasing order.

(b) Let T(n) be the runtime of the above binary search algorithm. Write down a recurrence relation for T(n).

3. Write down the merge-sort algorithm to sort n numbers in an array A in ascending order.

(a) First provide a description of the ideas used in the algorithm.

(b) Write down the pseudocode of the algorithm.

(c) Write a recurrence relation for the runtime, T(n), of this algorithm.

Please Show all Work!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!