#ifndef _MULTIWAY_H_
#define _MULTIWAY_H_

#include <string>

using namespace std;

class Multilist
{
  private:
    //  Nested class
    struct Node
    {
        int id;           //  ID number
        string name;      //  Last name
        Node *prev_id,    //  Previous ID, numerically
             *next_id,    //  Next ID, numerically
             *prev_name,  //  Previous name, alphabetically
             *next_name;  //  Previous name, alphabetically
        Node(int, string);
    };

    Node *first_id,       //  Lowest ID number
         *last_id,        //  Higher ID number
         *first_name,     //  Earliest alphabetical name
         *last_name;      //  Latest alphabetical name

  public:
    //  Creates a new empty multilist
    Multilist();
    //  Properly deallocates the space held by a multilist
    ~Multilist();
    //  Adds a new person to the list with the given last name
    //  and ID number.  Duplicate IDs are not allowed.  Returns
    //  true if the person was successfully inserted; 
    //  otherwise, return false.
    bool insert(int, string);
    //  Removes the person with the given ID number.  Returns
    //  true if the person was removed; otherwise, return false
    bool remove(int, string);
    //  Print the persons in order by ID number
    void print_by_ID();
    //  Print the persons in reverse order by ID number
    void print_by_ID_reverse();
    //  Print the persons in order by last name
    void print_by_name();
    //  Print the persons in reverse order by last name
    void print_by_name_reverse();
};

#endif
