#include<iostream>
#include<string>
#include"List.h"
using namespace std;

int main(){
	List<string> s;
    s.push_front("T"); s.push_front("N"); s.push_front("G"); s.push_front("A");
	
    for (List<string>::
Iterator si = s.begin(); si != s.end(); ++si) //prints AGNT
         cout << *si;  
	cout << endl;

	List<string>::
Iterator sj = s.end(); //points to one after last element
	//To get the next line to work you must modify operator-- to return an
	// Iterator & (i.e. *this).
	cout << *(sj--); 
	cout << *(sj--);
	cout << *(sj--);
	cout << *(sj--)<< endl; //they print TNGA


	List<string> t;
	t.push_back("A"); t.push_back("G"); t.push_back("N"); t.push_back("T");
	
	List<string>::
Iterator ti;
	for (ti = t.begin(); ti != t.end(); ++ti) //prints AGNT
         cout << *ti; 
	cout << endl;	


	ti = t.begin();
	ti++; ti++;
	t.insert(ti, "E");
	cout << t << endl; 	//prints A G E N T

	for (ti =t.begin(); ti != t.end(); ++ti)
		t.insert(ti, "-");
	t.insert(ti, "-");
	cout << t << endl; //prints - A - G - E - N - T -


	for (ti =t.begin(); ti != t.end(); ++ti){
		ti = t.erase(ti);
	}
	cout << t << endl;	//prints A G E N T


	List<int> i1;
	i1.push_back(5); i1.push_back(7); i1.push_back(15); i1.push_back(28);
	List<int> i2;
	i2.push_back(2); i2.push_back(6); i2.push_back(8); i2.push_back(21);
	i1.merge(i2); //i1 and i2 are sorted, the new i1 should also be sorted.
	cout << i1 << endl; //prints 2 5 6 7 8 15 21 28 
	cout << i2 << endl; //prints 2 6 8 21

	List<int> x;
	x.push_back(3); x.push_back(1); x.push_back(33); x.push_back(13);
	x.push_back(15); x.push_back(28); x.push_back(21); x.push_back(2);
	x.sort();
	cout << x << endl; //prints 1 2 3 13 15 21 28 33



    return 0;
}