-
How can a singly linked list be reversed using only two pointers?
I'm curious if there's a specific approach or logic to reverse a singly-linked list using only two pointers. Typically, the reversal involves the use of three-pointers, namely p, q, and r. struct node { int data; struct node *link; }; void reverse() { struct node *p = first...- Rishab7
- Thread
- reverse singly-linked
- Replies: 1
- Forum: Windows Software