-
-
Save BMuscle/9068cf334151f77ca613c4cf9e7718f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct List { | |
| int val; | |
| struct List* next; | |
| }; | |
| struct List* head; | |
| void add(int val) { | |
| struct List* list = head->next; | |
| struct List* prev = head; | |
| while (list != NULL) { | |
| prev = list; | |
| list = list->next; | |
| } | |
| struct List tmp; | |
| tmp.val = val; | |
| list->next = &tmp; | |
| } | |
| int main() | |
| { | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment