Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // SinglyLinkedList.hpp
- // 01_singly_linked_list
- //
- // Created by 박대호 on 2016. 10. 27..
- // Copyright © 2016년 박대호. All rights reserved.
- //
- #ifndef SinglyLinkedList_hpp
- #define SinglyLinkedList_hpp
- #include <iostream>
- using namespace std ;
- class Node {
- private:
- int element ;
- Node *next ;
- public:
- Node(const int = 0, Node* = NULL);
- friend class SLL ;
- };
- // Singly Linked List
- class SLL {
- private:
- Node *list_head ;
- int count ;
- public:
- SLL();
- SLL(const int);
- ~SLL();
- bool empty() const ;
- bool member(const int) const ;
- Node *head() const ;
- int front() const ;
- int size() const ;
- void push_front(const int);
- int pop_front();
- bool remove(const int);
- void print() const ;
- };
- #endif /* SinglyLinkedList_hpp */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement