ListDemo - */ LinkedList l2 ; l2.addToBack(10) ;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <fstream> #include "LinkedList.h" using namespace std ; int main () { LinkedList l ; l.addToBack(1) ; l.addToBack(2) ; l.addToBack(4) ; l.addToFront(7) ; l.addToFront(6) ; l.addToFront(5) ; cout << "The list: " << l << endl ; /* int v ; v = l.removeFromFront() ; cout << "Removed " << v << ", the list is: " << l << endl ; v = l.removeFromFront() ; cout << "Removed " << v << ", the list is: " << l << endl ; v = l.removeFromBack() ; cout << "Removed " << v << ", the list is: " << l << endl ; v = l.removeFromBack() ; cout << "Removed " << v << ", the list is: " << l << endl ;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: */ LinkedList l2 ; l2.addToBack(10) ; l2.addToBack(11) ; l2.addToBack(12) ; cout << "The 1st list: " << l << endl ; cout << "The 2nd list: " << l2 << endl ; l.append(l2) ; cout << "The 1st list: " << l << endl ; cout << "The 2nd list: " << l2 << endl ; LinkedList l3 ; l3.addToBack(100) ; l3.addToBack(101) ; l3.addToBack(102) ; l2 = l3 ; cout << "The 1st list: " << l << endl ; cout << "The 2nd list: " << l2 << endl ; cout << "The 3rd list: " << l3 << endl ; }...
View Full Document

This note was uploaded on 10/28/2010 for the course CSCI 1113 taught by Professor Staff during the Spring '08 term at Minnesota.

Page1 / 2

ListDemo - */ LinkedList l2 ; l2.addToBack(10) ;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online