Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The main objective of this lab is to study and analyze merge sort and its time complexity in different scenarios. Task 1: Write a program
The main objective of this lab is to study and analyze merge sort and its time complexity in different scenarios. Task 1: Write a program that performs recursive merge sort and compares the execution time for the following three conditions: A. The input list is sorted B. The input list is half sorted C. The input list is reversed Task 2: Analyze the theoretical time complexity of merge sort and justify your findings from Task 1. Task 3 (Extra Credit): Perform tasks 1 and 2 for iterative merge sort. Output Instructions The output screen would prompt the user to enter the number of elements and scenario A/B/C (see Task 1). The program would select the elements based on the desired scenario. Submission: Submit the report sheet and the source files to Canvas. The solution must be written in C++. No compression (e.g. zip, rar, etc.) is allowed. All files should be submitted separately
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