Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)

hello.h

By: erick016 on Oct 10th, 2013  |  syntax: None  |  size: 0.94 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifndef hello_H
  2. #define hello_H
  3.  
  4. typedef int el_t ;
  5.  
  6. // list node is defined here as a struct Node
  7. struct Node
  8. {
  9.   el_t Elem;   // elem is the element stored
  10.   Node   *Next;  // next is the pointer to the next node
  11. };
  12.  
  13. // I could have done class Node and add the data members under public
  14. // but it will use too much space
  15.  
  16.  
  17. class hello
  18. {
  19.  
  20.  protected:
  21.  
  22.   Node *Front;       // front  pointer
  23.   Node *Rear;        // rear   pointer
  24.   int  Count;        // counter for the number of elements
  25.  
  26.  
  27.  public:
  28.  
  29.   hello();
  30.   ~hello();
  31.  
  32.   class Underflow{};
  33.   class OutOfRange{};
  34.  
  35.   bool isEmpty();
  36.  
  37.   void displayAll();
  38.  
  39.   void addRear(el_t NewNum);
  40.  
  41.   void deleteFront(el_t& OldNum);
  42.  
  43.   void addFront(el_t NewNum);
  44.  
  45.   void deleteRear(el_t& OldNum);
  46.  
  47.   void deleteIth(int I, el_t& OldNum);
  48.  
  49.   void addbeforeIth(int I, el_t newNum);
  50.                        // constructor
  51.                          // destructor
  52. };
  53.  
  54. #endif