How can this circular linked list coding be implemented to be a linked list ?
-
How can this circular linked list coding be implemented to be a linked list ? #include #include #include class Cell { int info; Cell *next; Cell (int i) { info =i; next=this; } Cell( int i, Cell * n) { info=i;next=n; } friend class List; }; class List { Cell *rear; public : void put (int); void push(int); int pop(); int empty() {return rear==rear->next;} List() {rear=new cell (0);} ~List() { while (!empty() ) pop (); } };
-
How can this circular linked list coding be implemented to be a linked list ? #include #include #include class Cell { int info; Cell *next; Cell (int i) { info =i; next=this; } Cell( int i, Cell * n) { info=i;next=n; } friend class List; }; class List { Cell *rear; public : void put (int); void push(int); int pop(); int empty() {return rear==rear->next;} List() {rear=new cell (0);} ~List() { while (!empty() ) pop (); } };