File Compare
Write a program that opens two text files and reads their contentsinto two separate
queues. The program should then determine whether the files areidentical by comparing
the characters in the queues. When two nonidentical characters areencountered,
the program should display a message indicating that the files arenot the same. If both
queues contain the same set of characters, a message should bedisplayed indicating
that the files are identical.
// Copyright (c) 2013 __Pearson Education__. All rightsreserved.
/** ADT queue: Link-based implementation.
Listing 14-3.
@file LinkedQueue.h */
#ifndef _LINKED_QUEUE
#define _LINKED_QUEUE
#include \"QueueInterface.h\"
#include \"Node.h\"
#include \"PrecondViolatedExcep.h\"
template
class LinkedQueue : public QueueInterface
{
private:
  // The queue is implemented as a chain of linkednodes that has
  // two external pointers, a head pointer for frontof the queue and
  // a tail pointer for the back of the queue.
  Node* backPtr;
  Node* frontPtr;
public:
  LinkedQueue();
  LinkedQueue (const LinkedQueue& aQueue);
  ~LinkedQueue();
      bool isEmpty() const;
      bool enqueue(constItemType& newEntry);
      bool dequeue();
 Â
  /** @throw PrecondViolatedExcep if the queue isempty */
      ItemType peekFront() constthrow(PrecondViolatedExcep);
}; // end LinkedQueue
#include \"LinkedQueue.cpp\"
#endif