Print the first element

void printFirst(nodeType* theList)
{
  if (theList!=NULL)
     cout << "The first element is " << theList->info<< endl;
  else cout << "The list is empty\n";
}







Print the last element

void printLast(nodeType* theList)
{
  nodeType* current;
  current=theList;
  if (theList!=NULL)
  {
     while(current->link!=NULL)
        current=current->link;
     cout << "The last element is " << current->info<< endl;
  }
  else cout << "The list is empty\n";
}