
#ifdef GNU
#define std 
#include <iostream.h>
#else
#include <iostream>
#endif
#include "list.h"
#include "stack.h"

void
main( )
{
    List< int > int_list;
    List <int> l2;

    int_list.Insert( 5 );
    int_list.Insert( 10 );
    int_list.Insert( 8 );
    
    std::cout << "Initial list: " << int_list<< std::endl;

    l2 = int_list;
    std::cout << "Assignment operator works!: " << l2 << std::endl;

    std::cout << "Results of  Find(4): " << int_list.Find( 4 ) << std::endl;
    std::cout << "Results of  Find(10): " << int_list.Find( 10 ) << std::endl;

    int_list.Delete( 10 );
    std::cout << "List after deleting 10 (middle element): "
	      << int_list<< std::endl;
    
    // A stack of int; demo of push, pop and ouput routines
     Stack<int> sint;
     sint.Push(1);
     sint.Push(2);
     sint.Push(3);
     std::cout << "Correct Ouput Should Be 3 2 1" << std::endl;
     std::cout << sint << std::endl;
     std::cout << "Pop Value " << sint.Pop() << std::endl;
     std::cout << "Stack after Pop " << sint<< std::endl;

//      //Illustrating Polymorphism
//      List<int> *ListLike = &sint;
//      ListLike->Insert(6);
//      ListLike->Insert(7);
//      std::cout << sint<< std::endl;
//      ListLike = &int_list;
//      ListLike->Insert(6);
//      ListLike->Insert(7);
//      std::cout << int_list << std::endl;

//      //Exposing Implementation
//      sint.Delete(2);
//      std::cout << "After deleting 2:" <<  sint<< std::endl;

    
}
