Hi,

I want to create a C program that will do two functions as a part of a hospital waiting list.
Data storage must be dynamic, so linked lists are the way to go.

typedef structure
{
int rank;
char name;
structure *next;
} PATIENTS;

1: Record Patient.
This is accept one interger (the rank) and one string (the name).
The string is added to the list in priority order. '1' being the highest. You can have multiple people on the same rank.

2: Consult Patient.
This will accept a single interger (the rank).
This will remove the patient from the list with the highest priority value from the list. When there are more then one patient with the same rank, the earliest patient to arrive will be consulted.
Eg: each rank will act like FIFO list.
The function will return a patient's name.

I hope someone can help me.