Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / In this assignment, you will implement the following four methods on an incomplete implementation of a doubly-linked list:  append(const T& value): appends a node containing a specified value to the linked list; remove(const T& value): removes a node containing a specified value from the linked list; copy(const List<T> &rhs): copies all values from a specified linked list to the current linked list; makeEmpty(): deletes all nodes in the linked list

In this assignment, you will implement the following four methods on an incomplete implementation of a doubly-linked list:  append(const T& value): appends a node containing a specified value to the linked list; remove(const T& value): removes a node containing a specified value from the linked list; copy(const List<T> &rhs): copies all values from a specified linked list to the current linked list; makeEmpty(): deletes all nodes in the linked list

Sociology

In this assignment, you will implement the following four methods on an incomplete implementation of a doubly-linked list: 

  • append(const T& value): appends a node containing a specified value to the linked list;
  • remove(const T& value): removes a node containing a specified value from the linked list;
  • copy(const List<T> &rhs): copies all values from a specified linked list to the current linked list;
  • makeEmpty(): deletes all nodes in the linked list.

A doubly linked list is a linear collection of elements called nodes, each containing data and both previous and next pointers.   Insertion and removal of nodes in a linked list is efficient; only pointer reassignments are required unlike an array which may require shifting elements.  In this implementation of a doubly-linked list, the append() function is used to insert nodes; the remove() function is used to remove nodes.

1457_Figure.png

An understanding of copy constructors, destructors, and assignment operators is essential when working with data structures that use dynamic memory allocation.  Failure to implement these operations correctly may result in memory leaks.  The copy constructor, destructor, and assignment operator methods are not functional in this program because copy() and makeEmpty () have not been implemented.

Download the starter files for this assignment from the Files tab (Assignment6.zip).  Do not alter the class definition or driver code in any way.  Programs that crash are subject to a 50% penalty. Please submit the class implementation file only ("List.cpp"). PLEASE NOTE: You may not use any Standard Template Library (STL) classes for this assignment.  Use code provided by the instructor only.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE