Created
December 16, 2019 18:31
-
-
Save rahul4coding/67a53c26c455aed330648ccf14e8e53b to your computer and use it in GitHub Desktop.
Reverse Print a given linkedList | JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reversePrint(head) { | |
//recursion is king | |
if(head!==null){ | |
reversePrint(head.next); | |
return console.log(head.data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment