We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
just remove the Class and public
The final solution is:
staticSinglyLinkedListNodereverse(SinglyLinkedListNodellist){SinglyLinkedListNodecurr=llist;SinglyLinkedListNodeprev=null;SinglyLinkedListNodenext=null;while(curr!=null){next=curr.next;//firstly initialising next to its exact locationcurr.next=prev;//reversing the linkprev=curr;//will move prev by +1
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
Easiest Solution with c#
just remove the Class and public The final solution is: