Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Merge Sort PLEASE USE DATA FILE FOR USER INPUT - NO USER INPUT Data in file called A4.txt 41 53 97 67 62 82

C++ Merge Sort

image text in transcribed

PLEASE USE DATA FILE FOR USER INPUT - NO USER INPUT

Data in file called A4.txt

41 53 97 67 62 82 93 54 34 11 62 29 16 96 61 95 25 62 75 90 18 51 41 54 94 7 96 5 17 95 2 45 20 54 87 13 26 64 7 93 92 51 38 39 51 11 93 88 38 37 5 23 91 87 39 88 11 39 7 85 40 65 14 60 90 10 31 32 58 76 23 45 50 96 16 5 57 15 39 83 27 50 27 55 45 59 16 50 71 73 15 66 74 37 92 55 80 3 60 8 81 29 85 57 33 30 18 29 92 12 71 35 95 64 33 87 47 30 48 78 28 24 53 24 80 17 93 31 71 73 26 61 12 43 7 64 21 95 88 51 13 11 33 87 95 98 34 56 65 75 86 97 83 61 78 62 9 20 51 71 85 23 3 44 65 48 73 81 38 95 94 47 68 31 42 63 24 33 66 31 64 81 53 19 84 20 69 26 10 71 65 43 96 10 86 45 54 83 43 10 53 92 26 27 8 2 85 74 28 9 86 19 3 38 40 32 27 91 24 87 31 3 10 98 23 
1. Write a program that will read each line from A4.txt and store the numbers into an array. 2. Sort the number of that array using Merge sort algorithm (using recursion). 3. Show the output in file B4.txt. Note: In total there will be 15 lines in B4.txt, where each line will contain a sorted array. First two lines are given as sample. WO 1 Sample input: 2 41 53 97 67 62 82 93 54 34 11 62 29 16 96 61 95 25 62 75 90 18 51 41 54 94 7 96 5 17 95 s Sample output 6 11 16 29 34 41 53 54 61 62 62 67 82 93 96 97 7 5 7 17 18 25 41 51 54 62 75 90 94 95 95 96

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions