The Computer Center of Very Picky Junior College insists that all administrative programs be very efficient in their use of memory. The admissions office wants a program written that will list the people who have been offered admission according to their chosen major. The list must be in alphabetical order by major and names within majors.
Because the admissions offices has larger plans for this program than creating only a listing, they want the program to execute as quickly as possible. They will not tolerate performing an exchange type sort to put the names in alphabetical order. Nor will they permit a search of all the people's names just to list those in one major.
Your assignment (should you decide to accept it) is to write a PL/6 program that works within the restrictions of the computer center and the admissions office. The program should read file PICKY310. COMPSCI to get the names of the people who have been offered admission and their major. There are fewer than 100 names in this file; there are fewer than 12 majors. The format of a record in the file is as follows:
Columns 1-23 Name Columns 24-35 Major
After reading and ordering the people within their major, list the people who have been offered admission in each major.
Hints:
1. You cannot declare 12 arrays each large enough to hold 100 names. This would waste too much space.
2. You cannot partition a single array into 12 sections. You don't know how big to make each section.
3. You cannot use a single array without searching, sorting, or shuffling the elements. All these actions take too much time.
4. Your program should create a linked list such as the following:
where the majors are in order alphabetically and the names within each major are alphabetical. "AD" points to the beginning of the list.
5. Write internal procedures to handle setting up an available list and getting a node.