SOURCE FILE: cListP.cpp
// *********************************************************
// Implementation file cListP.cpp for the ADT list.
// Circular, singly-linked, pointer-based implementation.
// *********************************************************
#include "cListP.h" // header file
#include <stddef.h> // for NULL
#include <assert.h> // for assert()
struct listNode // a node on the list
{ listItemType Item; // a data item on the list
ptrType Next; // pointer to next node
}; // end struct
listClass::listClass(): Size(0), Last(NULL)
{
} // end default constructor
listClass::~listClass()
{
// FILL THIS IN
} // end destructor
bool listClass::ListIsEmpty() const
{
// FILL THIS IN
} // end ListIsEmpty
int listClass::ListLength() const
{
// FILL THIS IN
} // end ListLength
ptrType listClass::PtrTo(int Position) const
// --------------------------------------------------
// Locates a specified node in a circular linked list.
// Precondition: Position is the number of the
// desired node.
// Postcondition: Returns a pointer to the desired
// node. If Position < 1 or Position > the number of
// nodes in the list, returns NULL.
// --------------------------------------------------
{
// FILL THIS IN
} // end PtrTo
void listClass::ListRetrieve(int Position,
listItemType& DataItem,
bool& Success) const
{
// FILL THIS IN
} // end ListRetrieve
void listClass::ListInsert( int NewPosition, listItemType NewItem,
bool& Success)
{
// FILL THIS IN
} // end ListInsert
void listClass::ListDelete(int Position, bool& Success)
{
// FILL THIS IN
} // end ListDelete