// File:            06_RLowke_8hs_reverse.cpp
// ---------------------------------------------------------------------
//          Author: Russell Lowke,  lowke@fas.harvard.edu
//              TF: Francis Crick
//            Date: 8/6/2002
//      Assignment: Unit 8 Hard Supp programming exercises
//         Version: 1
//
//	   Description: Add to unit8/list.hpp reverse_list() that reverses the
//					order of the nodes in the list
//

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <values.h>
#include "listRv.hpp"


//
//  Prints list
//
void printList(list<int> mList)
{
	node<int> * ptr  = mList.first();
	node<int> * last = mList.end();

	cout << "{ ";
	while( ptr != last ) {
		cout << ptr->data << " ";
		ptr = mList.next_node(ptr);
	}  

	cout << "}" << endl;
}



int main()
{

	// moke list from 0 to 9
	list<int> mList;
	for (int i = 0; i < 10; i++) {
		mList.append(i);
	}

	// reverse
	mList.reverse_list();
	
	// print
	printList(mList);
	
	exit (0);
}