LinkedListStack and LinkedList_ADT_CPP

Download Category:

LinkedList.zip - (255.3 KB)
[
LinkedList/LinkedList.suo
LinkedList/LinkedList_ADT_CPP.cpp
LinkedList/LinkedListStack.cpp
LinkedList/Question.txt
LinkedList/Screenshot.jpg
LinkedList/Screenshot_1.jpg
]

Part 1:
Create a simple linked list program to create a class list containing
class node {
void *info;
node *next;
public:
node (void *v) {info = v; next = 0; }
void put_next (node *n) {next = n;}
node *get_next ( ) {return next;}
void *get_info ( ) {return info;}
};
Be able to initially fill the list. Provide functions to insert/append nodes and remove nodes from the linked list. Be able to display the contents of the list.
Write a little driver program with at least 5 values passed in (so that 5 nodes are created) as you insert/append, delete and display data, showing the programs operation

Part 2:
Create a program that uses a derived class based on the list class you’ve created in the first program. This program will use a stack data type.
class node {
void *info;
node *next;
public:
node (void *v) {info = v; next = 0; }
void put_next (node *n) {next = n;}
node *get_next ( ) {return next;}
void *get_info ( ) {return info;}
};
class list {
node *head;
int node_num;
public:
list ( ) { node_num = 0; head = 0;}
void remove (int);
void insert (void *, int);
void append (void * v) {insert (v, node_num + 1); }
void *find (int);
void display ( );
};
Write functions to push and pop the stack. Write a driver main program which gives 5 values (5 nodes created) that will push, pop and display data stored.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.