Skip to content

Commit

Permalink
Resolvoing the issue jainaman224#3109
Browse files Browse the repository at this point in the history
  • Loading branch information
codeingwolf authored Feb 3, 2021
1 parent 6033512 commit c9fd832
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Reverse linklist using resursion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class ReverseLinkedList {
public static void main(String[] args) {
LinkedList li=new LinkedList();
li.InsertData(5);
li.InsertData(55);
li.InsertData(555);
li.InsertData(5555);
Node head=li.head;
reverse(head);
}
public static void reverse(Node head)
{
if(head==null)
return;

reverse(head.next);
System.out.println(head.val);

}
}

0 comments on commit c9fd832

Please sign in to comment.