Question: Merge Sort C++ The US Census provides data regarding the population of the United States. Contained in the file countyPop.dat stored in the class directory

Merge Sort C++

Merge Sort C++ The US Census provides data regarding the population of

The US Census provides data regarding the population of the United States. Contained in the file "countyPop.dat" stored in the class directory on cs1 are the 2010 population numbers for all of the counties in the United States You are to read the data into an array, then use MergeSort to sort the values by population, either in non-descending or non-ascending order (your choice) Before sorting, print the first ten and last ten records to the screen. Once the entire set is sorted, print the first ten and last ten records to the screen. (Perhaps a print function?) Submit your program by typing the following command at the prompt in the same directory where the file is stored: home/fac/sreeder/submit/cpsc2430/lab5_runme The data file contains the population from the 2010 census followed by the name of the county and its state, as in: 34690 Clark County, Wisconsin. Each county information is on its own line. There are less than 3,200 lines of information. To read the file, use the following while loop (assuming all variables are properly declared and initialized): while (infile>>list[count].censusCount) getline(infile, list[count].place); count++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!