It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration. E. W. Dijkstra

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.



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



No comments available!

Please login to add comments.