The document discusses implementing various operations for a linked list data structure including: constructors, destructors, insertion, removal, traversal, and more. It provides template code definitions for a ListNode class and List class to represent nodes and the overall linked list. It also includes functions to insert and delete nodes at different positions, find the size, reverse, merge, and check for cycles in linked lists.
implement the ListLinked ADT (the declaration is given in ListLinked.pdf
1. implement the ListLinked ADT (the declaration is given in ListLinked.h)(60 points)
- implement the following operations:
- constructor, assignment operator, destructor
- insert, remove, replace, clear
- isFull, isEmpty
- gotoBeginning, gotoEnd, gotoNext, gotoPrior, getCursor
implement the function moveToBeginning() that removes the data item marked by the cursor and
reinserts it at the beginning of the list
- implement the function insertBefore(..) that will insert the new data item before the cursor or if
the list is empty as the first element of the list
#include "ListLinked.h"
// ListNode member functions
template
List::ListNode::ListNode(const DataType& nodeData, ListNode* nextPtr)
{
this->dataItem = nodeData;
this->next = nextPtr;
}
// List member functions
template
List::List(int ignored = 0)
{
}
template
List::List(const List& other)
{
}
template
List& List::operator=(const List& other)
{
}
template
List::~List()
{
}