queueSet


/*

#define NUM_SYMBOLS 10 

class queueSetClass 
{
  public :

/* ------------------------------------------------------------ */

      /* Read in a set of K-digit numbers from stdin, where K is
	 the value of the constant NUM_DIGITS defined in item.h */

    void LoadData() ;

/* ------------------------------------------------------------ */

              /* Insert item into queues[digIdx] - the queue which has index
		 equal to digIdx */

         void queueByDigit(int digIdx, itemClass item) ;

/* ------------------------------------------------------------ */

        /* PRECONDITION: A list of items is in the queueSet, each
	   item is in the queue corresponding to its one's digit.
	   This function repeatedly re-enqueues all the items by
	   more and more significant digits, according to the
	   radix sort algorithm.  POSTCONDITION: all items are in
	   the queue corresponing to the most significant digit.
	   */

    void DoMiddlePasses() ;

/* ------------------------------------------------------------ */

            /* Put a special marker item at the rear of each
	       queue */

         void InsertMarkers() ;

/* ------------------------------------------------------------ */

            /* Remove all the items from queue number "queueNum"
	       up to and including the marker.  Discard the
	       marker, but re-enqueue the other items.  Use
	       passNum to determine which digit position the
	       re-queuing will be based on. */

         void redistQueue(int queueNum, int passNum) ;

/* ------------------------------------------------------------ */

       /* The purpose of this function is to write out the sorted
	  list.  It goes to each queue, in turn, and empties it.
	  It writes each item out to standard output.  */

    void WriteOutData() ;

/* ------------------------------------------------------------ */

            /* Remove each item X from queue number "qNum" and
	       write X to standard output on a line by itself.
	       The queue items appear on standard output in the
	       same order that they are removed from the queue.
	       */

         void PurgeQ(int qNum) ;

/* ------------------------------------------------------------ */


        /* This is the array of queues */

    queueClass queues[NUM_SYMBOLS] ;

/* ------------------------------------------------------------ */
     
       /* End of Class Definition */
} ;