Question: Write a program in c++ to get min and max elements in an array using divide and conquer No sorting Program should divide array into
Write a program in c++ to get min and max elements in an array using divide and conquer
No sorting
Program should divide array into 2 then recursively divide on both arrays, after recursive calls are done combine results and report final result
- Write pseudocode of program
- Write recurrence relation of pseudocode as T(n) and solve it
- Write program in c++
Example input: [ 10, 8, 7, 13, 99, 12, 14, 77, 87, 78, 65, 64, 68, 2, 1, 4, 6]
Output:
Min in array is 1
Max in array is 99
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
