[SOLVED] 02393 C++ Programming Assignment 10

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

Rate this product

Doubly-Linked Lists

doubly-linked lists. The specifification of the class is provided in fifile doubly-linked.h,

available in CodeJudge. Such fifile is imported by the test programs. Your goal

is to implement the class in a fifile doubly-linked.cpp.

The class List implements lists using the following structures for list ele

ments:

s t r u c t Node {

i n t v al ;

Node ∗ nex t ;

Node ∗ prev ;

} ;

Each Node contains a value (an integer) and two pointers: one meant to

point to the next element of the list and one meant to point to the previous

element in the list.

The class provides the following methods that you need to implement:

  • A constructor and a destructor, with no arguments;
  • void insert(int n): insert an integer at the end of the list;
  • void reverse(void): reverse the list;
  • void print(void): print the list to cout in the same format as the input

(i.e. integers separated by spaces);

Challenge

Implement the class ignoring the prev link, i.e. as it would be a

single-linked list.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.