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

  1. Write pseudocode of program
  2. Write recurrence relation of pseudocode as T(n) and solve it
  3. 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

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!