Programming is like sex. One mistake and you have to support it for the rest of your life. Michael Sinz

Re-order list

Language Java | Level Intermediate | Category Data structure | September 5, 2015 10:11 pm

Data structure Description

Linked list is a data structure which has the group of nodes which together represent the sequence. Write a program to re-order the linked list with the last element with the first element?

If the program takes input as {34, 56, 78, 90}, the program return the re-ordered list {34, 90, 78, 56}



Print the list of items: 21->52->33->47->67->NULL
Print the list of items after reverse the order: 21->67->52->47->33->NULL



No comments available!

Please login to add comments.