Question: (a) Assume that you are going to develop an algorithm to find the position of the largest number in an array with n integer numbers
(a) Assume that you are going to develop an algorithm to find the position of the largest number in an array with n integer numbers using a divide-and-conquer technique. For example, if your algorithm has an input array such as 1, 3, 11, 7, 5, 6, 4, 9, your algorithm should return 2 because the index 2 has the largest number (= 11) in the array. Describe the basic idea of your divide-and-conquer algorithm in English.
[Hint: Read the sample function sum_div_N_conq() in the google document. You can get the basic idea of the problem from the function.]
(b) Based on the basic idea of (a), write a pseudocode (or real C++ code) of your divide-and-conquer algorithm. Note that the array index of your algorithm should start from zero.
(c) Determine the time complexity of your algorithm. As you learned in the class, you should use the Master Theorem to calculate the time complexity. So, you should provide the values of symbols a, b, and d. And then provide the time efficiency of your algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
