Advertisement
erick016

hello.h

Oct 10th, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement