Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class Node {
char data;
Node next;
static Node reverse(Node root){
Node reverseRoot = null;
while(root != null) {
Node next =; = reverseRoot;
reverseRoot = root;
root = next;
return reverseRoot;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.