Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

1. Introduction You will create a C++ program to sort data. After sorting the data, you need to output the required information to a plain

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1. Introduction You will create a C++ program to sort data. After sorting the data, you need to output the required information to a plain text file. 2. Input and Output a. Input data file 1) The input data file has multiple records (number > 1 and-100000). Your program should read the records one by one from the beginning of the file to the end. 2) Each record is a number which range from 0 to 99999999 (no decimal part), the numbers are separated by space or new line. Each number may appear more than once in one data file, add it even it duplicated 3) The input data file doesn't have dirty records, like letters and special characters b. Input command file the command line when calling your program, so you don't need to worry about the missing file name problem. When calling your program, the format would be one of the two standard types as below, no mixed calling type will be given. Notice also the quotes in the program call, to avoid Unix/Windows get confused. The general call to the executable is as follows: sort "input-input1.txt;output-output1.txt;command-command1.txt Call example with another command line type. sort input-input1.txt output-output1.txt command-command1.txt The execution time for each group of input files has threshold, if the time out of the range of the desired time, it fails. If the answers were not the same as correct answers, it fails too. Example 1 of input and output input31.txt 12345 6789 command31.txt quick sort ascending 0 5 2 Command line: sort input=input31.txt outputoutput31.txt sort:sort31.txt output31.txt 163 Example 2 of input and output input32.txt 134269 5 7 100 20 command32.txt shell sort descending 2 4 6 Command line: sort "input-input32.txt;output-output32.txt,command-command32.txt" output32.txt 9 64 Example 3 of input and output input33.txt 1357911 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 command33.txt merge sort 1 3 5 Command line: sort input-input33.txt output-output33.txt command-command33.txt output33.txt 37 11 You may see the time limitation when you run test.sh. Real test cases differ from above three examples. 5. Requirements summary Per different sort type, you must create an array or a linked list to store the data. Your program will be tested with GNU C++. Therefore, you are encouraged to work on Unix. You can use other C++ compilers, but the TAs cannot provide support or test your programs with other compilers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions