The solution must work for any arbitrarily large file ie


The text file citytpr.txt containing temperature readings for various cities, ]a Raptor algorithm needs to be created to sort the temperatures in decreasing values. The sorted temperatures shall be written to a file called sortedcitytpr.txt. The content of the files citytpr.txt and sortedcitytpr.txt must be stored in the formats shown below. For each city, the citytpr.txt includes the city name and the temperature respectively. The solution must work for any arbitrarily large file ( i.e. the number of city-temperature records must not be hard coded in the algorithm).

I have completed a selction and insert algorithm but i need help with a bubble sorting algorithm. I'm also mostly confused on how to do the swap.

Content of citytpr.txt

Kingston

10

Milton

4

Calgary

2

Vancouver

14

London

11

Content of sortedcitytpr.txt

Vancouver: 14

London : 11

Kingston : 10

Milton : 4

Calgary : 2

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: The solution must work for any arbitrarily large file ie
Reference No:- TGS02830626

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)