Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Node {
- public:
- Node(int _data)
- : data{_data}, prev{this}, next{this}
- {}
- Node* getNext() const {
- return next;
- }
- private:
- Node* prev;
- int data;
- Node* next;
- };
- class DLinkedCircList {
- public:
- DLinkedCircList()
- : head{nullptr}, size{0} {
- }
- void push_back(int input) {
- Node* nodePtr{new Node{input}};
- //did the memory get allocated???
- if (head == nullptr) {
- head = nodePtr;
- }
- else { //add to end
- }
- size +=1;
- }
- private:
- Node* head;
- int size;
- };
- int main()
- {
- DLinkedCircList testList{};
- cout << "Hello world!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement