Identify a problem that can efficiently be solved with merge sort. Implement the merge sort...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
• Identify a problem that can efficiently be solved with merge sort. • Implement the merge sort algorithm . Determine and summarize the algorithmic run-time of the merge sort algorithm. As you saw from your readings and exercises, Merge Sort is based upon the idea of divide-and-conquer. If implemented correctly, your merge sort algorithm should have a time complexity of O(n*log(n)). • write a program that utilizes the merge sort algorithm. You can identify any problem that you wish (or make up a hypothetical problem), but the sorting algorithm that you must use to sort the data is merge sort. It is up to you (your choice) as to how you want to utilize merge sort within your program. Once you have finished, write a small summary to describe the algorithmic time complexity of merge sort. Example: (If you're having a hard time coming up with your own idea, then you may use my example problem below.) Mrs. Wh has 31 students take an exam. She is presented with 31 decimal values which represent exam scores. The scores are stored in an array. She would like you to write a program which will sort those scores into ascending order (using merge sort). Here is the example output of the program: Scores BEFORE sorting with merge sort: 66.70 53.80, 45.30, 85.67, 23.30 90.98, 46.50, 9.00, 74.87, 68.90, 84.00 82.00, 36.00, 19.98, 42.00, 58.30, 31.00. 40.00, 76.00, 86.0 0, 97.30, 20.98, 80.00, 54.98, 27.00, 45.98, 93.00, 82.00, 69.00, 89 .00 28.98 Scores AFTER sorting with merge sort: 9.00, 19.98, 20.98, 23.30, 27.00, 28.98, 31.00, 36.00, 40.00, 42.00, 45.30, 45.98, 46.50, 53.80, 54.98, 58.30, 66.70, 68.90, 69.00, 74.8 7, 76.00, 80.00, 82.00, 82.00, 84.00, 85.67, 86.00, 89.00, 90.98, 93 .00 97.30 Don't forget the summary of the time complexity of the merge sort algorithm. An example of this is not included here. • Identify a problem that can efficiently be solved with merge sort. • Implement the merge sort algorithm . Determine and summarize the algorithmic run-time of the merge sort algorithm. As you saw from your readings and exercises, Merge Sort is based upon the idea of divide-and-conquer. If implemented correctly, your merge sort algorithm should have a time complexity of O(n*log(n)). • write a program that utilizes the merge sort algorithm. You can identify any problem that you wish (or make up a hypothetical problem), but the sorting algorithm that you must use to sort the data is merge sort. It is up to you (your choice) as to how you want to utilize merge sort within your program. Once you have finished, write a small summary to describe the algorithmic time complexity of merge sort. Example: (If you're having a hard time coming up with your own idea, then you may use my example problem below.) Mrs. Wh has 31 students take an exam. She is presented with 31 decimal values which represent exam scores. The scores are stored in an array. She would like you to write a program which will sort those scores into ascending order (using merge sort). Here is the example output of the program: Scores BEFORE sorting with merge sort: 66.70 53.80, 45.30, 85.67, 23.30 90.98, 46.50, 9.00, 74.87, 68.90, 84.00 82.00, 36.00, 19.98, 42.00, 58.30, 31.00. 40.00, 76.00, 86.0 0, 97.30, 20.98, 80.00, 54.98, 27.00, 45.98, 93.00, 82.00, 69.00, 89 .00 28.98 Scores AFTER sorting with merge sort: 9.00, 19.98, 20.98, 23.30, 27.00, 28.98, 31.00, 36.00, 40.00, 42.00, 45.30, 45.98, 46.50, 53.80, 54.98, 58.30, 66.70, 68.90, 69.00, 74.8 7, 76.00, 80.00, 82.00, 82.00, 84.00, 85.67, 86.00, 89.00, 90.98, 93 .00 97.30 Don't forget the summary of the time complexity of the merge sort algorithm. An example of this is not included here.
Expert Answer:
Answer rating: 100% (QA)
The problem that is being handled using Merge sort is Inversion count in Array Problem Definition How far or close an array is to being sorted is indi... View the full answer
Related Book For
Artificial Intelligence A Modern Approach
ISBN: 9780134610993
4th Edition
Authors: Stuart Russell, Peter Norvig
Posted Date:
Students also viewed these algorithms questions
-
1. 500 people responded to a newspaper survey. The purpose of the survey was to figure out how many people liked the cartoon Tom & Jerry vs. The road runner. 275 people liked the road runner and 172...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Alpha corp reports the following results for the current year: net income per books (before federal income taxes ) 738,000 federal income tax expense per books (156,240) net income per books (after...
-
Find the point on the line y = 4x + 7 that is closest to the origin.
-
Draw a use case diagram based on the level-0 diagram in Figure 7-23. How does your use case diagram for Figure 7-23 differ from the one in Figure 7-26, which is also about registering for classes? To...
-
Explain what is meant by the medical record battleground.
-
While playing a coin- tossing game in which you are to guess whether heads or tails will appear, you observe 30 heads in a string of 50 coin tosses. (a) Test the null hypothesis that this coin is...
-
How do you reconcile the tension between optimizing temporal efficiency and fostering sustainable long-term productivity and well-being ?
-
Given a database of the results of an election, find the number of seats won by each party. There are some rules to going about this: There are many constituencies in a state and many candidates who...
-
Exchange risk adjustment for risky cashflows can be done using currency content analysis for foreign project valuation. This is useful because it facilitates MNC capital budgeting and hedging...
-
Indicate whether each of the following statements is true or false by writing T or F in t he a nswer c olumn. In all states, the crime of bribery is limited to giving or taking money or property to...
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. No contract is enforceable without consideration.
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. The executive branch of government sees that all enacted legislation is enforced.
-
Indicate whether each of the following statements is true or false by writing T or F in t he a nswer c olumn. The theft of goods from a vehicle in transit is known as hijacking.
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. A general release allows for the discharge of a debt because it is viewed as forbearance, a...
-
Why is mercury liquid at room temperature?
-
Charles owns an office building and land that are used in his trade or business. The office building and land were acquired in 1978 for $800,000 and $100,000, respectively. During the current year,...
-
Label the blank nodes in the Bayes net below with the variables {A, B, C, E} such that the following independence assertions are true: A is conditionally independent of B given D, E; E is...
-
A k-zigzag network has k Boolean root variables and k + 1 Boolean leaf variables, where root i is connected to leaves i and i + 1. Figure S13.52 shows an example for k = 3, where each D i represents...
-
Here is pseudocode for three agent programs A, B, C: In each of these agents, the function f is some arbitrary, possibly randomized, function of its inputs with no internal state of its own; the...
-
A fertilizer producing company purchases nitrates, phosphates, potash, and an inert chalk base and produces four different fertilizers A, B,C, and D. The cost of these nitrates, phosphates, potash,...
-
We are interested to produce $P$ in the reaction $A ightarrow P$ using a continuous reactor at $v=240$ liters/ hr with $C_{A_{0}}=3$ moles/liter. However, it is noticed that there is a second...
-
Heavy fuel oil, initially semisolid at $15^{\circ} \mathrm{C}$ is to be heated and pumped through a $15 \mathrm{~cm}$ diameter (inside) pipe at the rate of $20000 \mathrm{~kg} / \mathrm{h}$. The pipe...
Study smarter with the SolutionInn App