Professional Documents
Culture Documents
a value that does not correspond to any index in the list int
NULL_VALUE=-1;
//one to identify the data part and the other to identify the
LinkedList<DataType>::LinkedList() { int i;
free=0; size =0; //intialize pool of free new nodes for (i=0;
node and the type of the operation (i for insert and d for
position does not exist in the list else if (oper == 'i' &&
for deletion else if (oper == 'd' && (pos<1 || pos > size))
that in the following else the if and its conditions are not
does not currently exist, and in this case // the new node
deleted node to the first node in the list of free nodes free
deleted node to the first node in the list of free nodes free
cout << "The list has " << size << " element(s) now." <<
endl; } // end of function print #endif