A Way For Learning

Reverse a Single Linked List

No comments
Reverse a Single Linked List

Node current=Head;
Node previous=null;
Node next=null;

while(current!=null){
next=current.next;
 current.next=previous;
 previous=current;
 current=next;
}

No comments :

Post a Comment