The evolution of languages: FORTRAN is a non-typed language. C is a weakly typed language. Ada is a strongly typed language. C++ is a strongly hyped language. Ron Sercely

Reverse a Doubly Linked List

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


Data structure Description

Doubly linked list contain data, previous and next node links in each node. The links help to navigate the linked list backward and forward easily.

Write a program to reverse the doubly linked list elements. If the doubly linked list contains 12->45->90->22->48 elements, the reverse function reverse the linked list and return the result 48->22->90->45->12.


Output

   					 

List : 0->1->2->3->4->5->6->7->8->9->NULL
Reversing the list
List : 9->8->7->6->5->4->3->2->1->0->NULL

				    

Comments


No comments available!

Please login to add comments.