Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include "list.h"
- using namespace std;
- int main()
- {
- List l;
- l.appendNode(6);
- l.appendNode(19);
- l.appendNode(21);
- //Display initial values
- cout << "Here are the initial values:\n";
- l.displayList();
- cout << endl;
- //Delete middle node
- cout << "Now deleting the node in the middle.\n";
- l.deleteNode(19);
- //Display the list
- cout << "Here are the nodes left:\n";
- l.displayList();
- cout << endl;
- //Insert new middle node
- cout << "Inserting a new node in the middle:\n";
- l.insertNode(11);
- //Display the list
- cout << "Here is the new list:\n";
- l.displayList();
- cout << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment