Reverse a Doubly Linked List

Modify the _DoublyLinkedBase class to include a reverse public method
that reverses the order of the list, yet without creating or destroying
any nodes.

Write a program that uses the PositionalList class (included in the
public files section of the problem statement) to read a sequence of n
integer numbers, reverse the sequence, write the reversed sequence, and
traverse the reversed sequence from back to front printing the elements
in that order.

Input

    25
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 4

Output

    25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 

Problem information

Author: Josefina Sierra Santibáñez

Generation: 2026-01-25T19:35:12.982Z

© Jutge.org, 2006–2026.
https://jutge.org
