Question
please do it in python and Attach screenshots of the program and results Exercise-3: Write a program to find maximum and minimum element in a
please do it in python and Attach screenshots of the program and results
Exercise-3: Write a program to find maximum and minimum element in a list (or an array) using Divide and Conquer strategy and analyze the time complexity. Also, calculate the actual CPU time it took find the minimum and maximum elements.
Steps to perform Divide and Conquer 1. To use divide and conquer as an algorithm design technique, you must divide the problem into two smaller sub problems, solve each of them recursively, and then merge the two partial solutions into one solution to the full problem. 2. Whenever the merging takes less time than solving the two sub problems, we get an efficient algorithm. Divide-and conquer is a general algorithm design paradigm: 1. Divide: divide the input data S in two or more disjoint subsets S1, S2, ... 2. Recurrence: solve the sub problems recursively 3. Conquer: combine the solutions for S1, S2, ..., into a solution for S.
# Attach screenshots of the program and results # Explain your understanding about the time complexity for finding minimum element. # Explain your understanding about the time complexity for finding maximum element. # CPU time to find minimum in 1000 and 10000 elements. # CPU time to find maximum in 1000 and 10000 elements.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started