*Directions* In the code provided fill in whats needed for each of the following: *Start Implementin

*Directions*

In the code provided fill in whats needed for each of the following:

*Start Implementing the operations of the ListLinked class

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

5.1 Implement List::ListNode::ListNode(const DataType& nodeData, ListNode* nextPtr)

5.2 Implement List::List(int ignored)

5.3 Implement List::List(const List& other)

5.4 Implement List& List::operator=(const List& other)

5.5 Implement List::~List()

5.6 Implement void List::insert(const DataType& newDataItem) throw (logic_error)

5.7 Implement void List::remove() throw (logic_error) throw (logic_error)

5.8 Implement void List::replace(const DataType& newDataItem) throw (logic_error)

5.9 Implement void List::clear()

5.10 Implement bool List::isEmpty() const

5.11 Implement bool List::isFull() const

5.12 Implement void List::gotoBeginning() throw (logic_error)

5.13 Implement void List::gotoEnd() throw (logic_error)

5.14 Implement bool List::gotoNext() throw (logic_error)

5.15 Implement bool List::gotoPrior() throw (logic_error)

5.16 Implement DataType List::getCursor() const throw (logic_error)

5.17 Implement void List::showStructure() const

5.18 Implement void List:: moveToBeginning() throw ( logic_error )

5.19 Implement void List:: insertBefore ( const DataType &newDataItem ) throw ( logic_error )

//——————————————————————–

// Laboratory 5 ListLinked.cpp

//

//

//——————————————————————–

#ifndef LISTLINKED_CPP

#define LISTLINKED_CPP

using namespace std;

#include            // For showStructure

#include “ListLinked.h”

template

List::ListNode::ListNode(const DataType& nodeData,

               ListNode* nextPtr)

// Creates a list node containing item elem and next pointer

// nextPtr.

{

   this->dataItem = nodeData;

   this->dataItem = nextPtr;

}

//——————————————————————–

template

List::List(int ignored)

// Creates an empty list. The argument is included for compatibility

// with the array implementation (maxSize specifier) and is ignored.

{

}

//——————————————————————–

template

List::List(const List& other)

// Copy constructor. Creates a list which is equivalent in content

// to the “other” list.

{

}

//——————————————————————–

template

List& List::operator=(const List& other)

// Overloaded assignment operator. Reinitializes the list to be

// equivalent in content to the “other” list.

{

}

//——————————————————————–

template

List::~List()

// Destructor. Frees the memory used by a list.

{   

}

//——————————————————————–

template

void List::insert(const DataType& newDataItem) throw (logic_error)

// Inserts newDataItem after the cursor. If the list is empty, then

// newDataItem is inserted as the first (and only) item in the list.

// In either case, moves the cursor to newDataItem.

{

}

//——————————————————————–

template

void List::remove() throw (logic_error)

// Removes the item marked by the cursor from a list. Moves the

// cursor to the next item in the list. Assumes that the first list

// item “follows” the last list item.

{

}

//——————————————————————–

template

void List::replace(const DataType& newDataItem) throw (logic_error)

// Replaces the item marked by the cursor with newDataItem and

// leaves the cursor at newDataItem.

{

}

//——————————————————————–

template

void List::clear()

// Removes all the items from a list. Sets head and cursor to 0.

{

}

//——————————————————————–

template

bool List::isEmpty() const

// Returns true if a list is empty. Otherwise, returns false.

{

return false;

}

//——————————————————————–

template

bool List::isFull() const

// Returns true if a list is full. Otherwise, returns false.

{

return false;

}

//——————————————————————–

template

void List::gotoBeginning() throw (logic_error)

// If a list is not empty, then moves the cursor to the beginning of

// the list. If list is empty, throws logic error.

{

}

//——————————————————————–

template

void List::gotoEnd() throw (logic_error)

// If a list is not empty, then moves the cursor to the end of the

// list. Otherwise, throws logic_error.

{

}

//——————————————————————–

template

bool List::gotoNext() throw (logic_error)

// If the cursor is not at the end of a list, then moves the

// cursor to the next item in the list and returns true. Otherwise,

// leaves cursor unmoved and returns false.

{

return false;

}

//——————————————————————–

template

bool List::gotoPrior() throw (logic_error)

// If the cursor is not at the beginning of a list, then moves the

// cursor to the preceeding item in the list and returns true.

// Otherwise, returns false.

{

return false;

}

//——————————————————————–

template

DataType List::getCursor() const throw (logic_error)

// Returns the item marked by the cursor. Requires that list is not empty.

{

DataType t;

   return t;

}

//——————————————————————–

template

void List::showStructure() const

// Outputs the items in a list. If the list is empty, outputs

// “Empty list”. This operation is intended for testing and

// debugging purposes only.

{

if ( isEmpty() )

{

   cout

}

else

{

   for (ListNode* temp = head; temp != 0; temp = temp->next) {

      if (temp == cursor) {

       cout

      }

      // Assumes that dataItem can be printed via

      // is is either primitive or operator

      cout << temp->dataItem;

      if (temp == cursor) {

       cout

      }

      cout

   }

   cout

}

}

//——————————————————————–

//

// Programming Exercises 2 and 3

//

//——————————————————————–

// Programming exercise 2

template < typename DataType >

void List:: moveToBeginning() throw ( logic_error )

// Removes the item marked by the cursor from a list and

// reinserts it at the beginning of the list. Moves the cursor to the

// beginning of the list.

{

}

//——————————————————————–

// Programming exercise 3

template < typename DataType >

void List:: insertBefore ( const DataType &newDataItem )

throw ( logic_error )

// Inserts newDataItem before the cursor. If the list is empty, then

// newDataItem is inserted as the first (and only) item in the list.

// In either case, moves the cursor to newDataItem.

{

}

#endif       // #ifndef LISTLINKED_CPP

 

Looking for a Similar Assignment? Let us take care of your classwork while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Use Code FREE15