Skip to content

Instantly share code, notes, and snippets.

@duyet
Created June 21, 2014 15:13
Show Gist options
  • Select an option

  • Save duyet/88435bfbf7423825531b to your computer and use it in GitHub Desktop.

Select an option

Save duyet/88435bfbf7423825531b to your computer and use it in GitHub Desktop.
Đảo danh sách liên kết đơn
// list action
inline void reverse(LIST * L) {
NODE * next;
NODE * curr = L->head;
NODE * prev = NULL;
while (curr != NULL) {
next = curr->next;
curr->next = prev;
prev = curr;
curr = next;
}
L->head = prev;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment