//COMS 2203 01
//LAB #9 11-05.04
//CLINT BROWN
//ListType.cpp


#include "ListType.h"
#include <iostream>
#include <cstddef> // FOR NULL

using namespace std;

ListType::ListType()
{
  head = tail = NULL; // makes an empty list

}

void ListType::append(int x)
{
  NodeType *p;
  p = new NodeType;
  p->info = x;
  p->next = NULL;
  
  if(head == NULL)
  {
    head = tail = p;
    p->info = x; 
    tail->next = p;
    tail = p;
    tail-> next = NULL;
  }
  else

    p->info = x;
    tail->next = p;
    tail = p;
    tail->next = NULL;
      

  
}

void ListType::print()
{
  NodeType *p;
  p = head;
  while(p != NULL)
  {
    cout << p->info << endl;
    p = p->next;

  }


}

