A C programming assignment

computer science

Description

I'm working on a C programming assignment, and i'm encountering difficulty implementing the last two functions of my program, everything else has been completed. The needed functions are to take a linked list that has been populated with data from an input file and sort either alphabetically, or by latitude. Full details and code thus far are attached, with function descriptions below. Any tutor who is able to help would be greatly appreciated.

voidsortByLocID(lListAirPdata*airports);

Description: Sorts the airports alphabetically by the string named Loc ID with only one airport per letter. That is the first airport to begin with a Loc ID starting

with the letter A would be the only airport beginning with the letter A.

Increments the seqNumber as each airport is updated as a selected output.

SpecialCases: Remember the helipads! In other words, it is acceptable to skip airports whose Loc ID begin with a number, or start with either FL or X followed by two digits.

Caveat: Since the sorting options are mutually exclusive, this function can destructively manipulate the input list to produce the desired results.

Hint: It might be faster to use the Loc ID as a hash value or perhaps as an index into an array, after all, there can only be one airport per letter of the alphabet.

Returns: Nothing. However the input data should be seriously modified by this process.


voidsortByLatitude(lListAirPdata*airports);

Description: Sorts the airports by latitude from South to North. Think of this as an Escape from Key West to Georgia.

Increments the seqNumber as each airport is updated as a selected output.

SpecialCases: Remember the helipads! In other words, it is acceptable to skip airports whose Loc ID begin with a number, or start with either FL or X followed by two digits.

Output: Output the airports’ data per the output file specification derived from walking thru the AVL tree until reaching the maximum latitude for the Florida border. For the purposed of this exercise, assume 31 degrees North.

Caveat: Since the sorting options are mutually exclusive, this function can destructively manipulate the input list to produce the desired results.

Hint: It might be faster to use the Latitude as a measurement criteria for building an AVL tree.

Returns: Nothing. However the input data should be seriously modified by this process


Related Questions in computer science category