CPSC 2430-02 Lab #5 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

This lab exercises your understanding of MergeSort on large data sets.
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++;
}