Source of SL_PriorityQueue.cpp


  1: //  Created by Frank M. Carrano and Tim Henry.
//  Copyright (c) 2013 __Pearson Education__. All rights reserved.
// PARITALLY COMPLETE.

/** ADT priority queue: ADT sorted list implementation.
 @file SL_PriorityQueue.cpp */
 
#include "SL_PriorityQueue.h"  // Header file

template<class ItemType>
bool SL_PriorityQueue<ItemType>::add(const ItemType& newEntry)
{ 
   slistPtr->insertSorted(newEntry);
   return true;
}  // end add

template<class ItemType>
bool SL_PriorityQueue<ItemType>::remove()
{
   // The highest priority item is at the end of the sorted list
   return slistPtr->remove(slistPtr->getLength());
}  // end remove