Write a C function to reverse a given Doubly Linked List See below diagrams for example. (a) Original Doubly Linked List (b) Reversed Doubly Linked List Here is a simple method for reversing a Doubly Linked List. All we need to do is swap prev and next pointers for all nodes, change prev of the head (or start) and change the head pointer in the end. /* Program to reverse a doubly linked list */ #include
Read full article from Reverse a Doubly Linked List | GeeksforGeeks
No comments:
Post a Comment