This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 24th, 2013  |  syntax: None  |  size: 0.60 KB  |  views: 40  |  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. numberlist.h file
  2.  
  3.  
  4. // Specification file for the NumberList class
  5. #ifndef NUMBERLIST_H
  6. #define NUMBERLIST_H
  7.  
  8. class NumberList
  9. {
  10. private:
  11.         // Declare a structure for the list
  12.         struct ListNode
  13.         {
  14.                 int value;           // The value in this node
  15.                 struct ListNode *next;  // To point to the next node
  16.         };
  17.  
  18.         ListNode *head;            // List head pointer
  19.  
  20. public:
  21.         // Constructor
  22.         NumberList()
  23.         { head = NULL; }
  24.  
  25.         // Destructor
  26.         ~NumberList();
  27.  
  28.         // Linked list operations
  29.         void appendNode(int);
  30.         void insertNode(int);
  31.         void deleteNode(int);
  32.         void displayList() const;
  33. };
  34. #endif
clone this paste RAW Paste Data