Suggested problems

Reversed Linked List for data science

Feb. 10, 2021, 1:33 p.m. by kiransam

Problem

You are given a linked list that contains integers. You have performed the following reverse operation on the list:

Given: Select all the subparts of the list that contain only even integers. For example, if the list is , then the selected subparts will be , . Reverse the selected subpart such as and . Now, you are required to retrieve the original list.

Return: Note: You should use the following definition of the linked list for this problem:

Check out this website on Data Science Course in Chennai for more details

Sample Dataset

9
2 18 24 3 5 7 9 6 12

Sample Output

24 18 2 3 5 7 9 12 6