[SOLVED] 02393 Assignment 10-Doubly-Linked Lists

35.00 $

Category: Tags: , , , ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment-10-Linked_Lists-gka3sw.zip (1074.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Doubly-Linked Lists The goal of the exercise is to implement a class List of doubly-linked lists. The specification of the class is provided in file doubly-linked.h, available in CodeJudge. Such file is imported by the test programs. Your goal
is to implement the class in a file doubly-linked.cpp.

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

struct Node { int val ;

Node βˆ— next;

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.

  • Assignment-10-Linked_Lists-gka3sw.zip