Comment on page

### Explanation

* Step 0: ListNode* prev = NULL;
* ListNode* next = NULL;
*
* v v
* NULL "1" -> "2" -> "3" -> NULL
* prev^ ^next
*
*
* Step 1: next = curr->next;
*
* v v
* NULL "1" -> "2" -> "3" -> NULL
* prev^ ^next
*
*
* Step 2: curr->next = prev;
*
* v v
* NULL <-- "1" "2" -> "3" -> NULL
* prev^ ^next
*
*
* Step 3: prev = curr;
* curr = next;
*
* v v
* NULL <-- "1" "2" -> "3" -> NULL
* prev^ ^next

### C version

#include <stdio.h>
#include <stdlib.h>
struct Node{
struct Node* next;
int val;
};
struct Node* prev = NULL;
struct Node* next = NULL;
while(now != NULL){
next = now->next;
now->next = prev;
prev = now;
now = next;
}
}
void enqueue(struct Node **root, int value){
struct Node* new_node = (struct Node*) malloc (sizeof(struct Node));
new_node->val = value;
new_node->next = *root;
*root = new_node;
}
void traverse(struct Node* ref){
struct Node* tmp = ref;
while(tmp!= NULL){
printf("%d\n", tmp->val);
tmp = tmp->next;
}
}
Test code:
int main() {
struct Node* root = NULL;
enqueue(&root, 0);
enqueue(&root, 1);
enqueue(&root, 2);
enqueue(&root, 3);
enqueue(&root, 4);
traverse(root);
reverse(&root);
traverse(root);
return 0;
}