Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. //
  2. // SinglyLinkedList.hpp
  3. // 01_singly_linked_list
  4. //
  5. // Created by 박대호 on 2016. 10. 27..
  6. // Copyright © 2016년 박대호. All rights reserved.
  7. //
  8.  
  9. #ifndef SinglyLinkedList_hpp
  10. #define SinglyLinkedList_hpp
  11.  
  12. #include <iostream>
  13. using namespace std ;
  14.  
  15. class Node {
  16.  
  17. private:
  18. int element ;
  19. Node *next ;
  20.  
  21. public:
  22. Node(const int = 0, Node* = NULL);
  23.  
  24. friend class SLL ;
  25. };
  26.  
  27. // Singly Linked List
  28. class SLL {
  29.  
  30. private:
  31. Node *list_head ;
  32. int count ;
  33.  
  34. public:
  35. SLL();
  36. SLL(const int);
  37. ~SLL();
  38.  
  39. bool empty() const ;
  40. bool member(const int) const ;
  41. Node *head() const ;
  42. int front() const ;
  43. int size() const ;
  44.  
  45. void push_front(const int);
  46. int pop_front();
  47. bool remove(const int);
  48. void print() const ;
  49. };
  50.  
  51. #endif /* SinglyLinkedList_hpp */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement