Question: Write a C + + program that works with Linked Lists and performs the following operations: reverse Description: * reverses the contents of the linked

Write a C++ program that works with Linked Lists and performs the following operations:
reverse
Description: *reverses the contents of the linked list
*returns a pointer to the head of the new linked list
*Work with singly linked lists, DO NOT use doubly linked lists.
*The list must mutate, that is, the list received as a parameter must disappear, only the new list persists
Input: Pointer (to pointer) to the beginning of the list to be reversed
Output: Pointer to the beginning of the new linked list (reordered)
Precondition: A valid linked list
Postcondition: A valid linked list
equals
Description: Checks if two linked lists have the same content.
Input: two pointers to valid linked lists
Output: true / false
Precondition: two valid linked lists
Postcondition: two valid linked lists
concat
Description: Concatenates list1+ list2
Input: two pointers to valid linked lists
Output: nothing
Precondition: both linked lists are valid
Postcondition: The first linked list contains the elements it originally contained plus the elements of the other linked list
All functionalities must be correctly aligned and documented. The complexity of each of them must be included as part of the documentation.
input:
m
m integer data
n
n integer data
output :
reversed list 1
reversed list 2
reversed list 2+ reversed list 1
true / false
Input example:
5
65
32
45
78
99
4
45
14
256
36
Output example
99
78
45
32
65
36
256
14
45
36
256
14
45
99
78
45
32
65
false

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!