You are viewing a single comment's thread. Return to all comments →
C#
public static SinglyLinkedListNode reverse(SinglyLinkedListNode llist) { SinglyLinkedListNode prev= null, next = null; while(llist != null) { next = llist.next; llist.next = prev; prev = llist; llist = next; } return prev; }
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
C#