EX.9.5 A hospital ward contains ten beds, of which eight are occupiped as shown in Table 9-5. Here the pointer gives the address (bed number) of the pati9ent whoes name alphabetically follows that of the given patient. We also usethe variable FIRSTNAME to store the address of the first patient in the list. Thus FIRSTNAME=6, since patient Brown occupies bed 6. Also, Brown's pointer is 1, since Davis, the next name, occupies bed 1; Davis's pointer is 8, since Evans, the next name, occupies bad 8; and so on. We usethe special characher * (asterisk) for the pointer of the last name, wallace.
the empty beds are searately linked; FIRSTEMP stores the address of the first empty bed