1 List Reverse(List L) 2 { 3 Node *new_head, *old_head, temp; 4 new_head = NULL; 5 old_head = L; 6 while(old_head) 7 { 8 temp = old_head->next; 9 old_head->next = new_head; 10 new_head = old_head; 11 old_head = temp; 12 } 13 14 L = new_head; 15 return L; 16 }
原文地址:https://www.cnblogs.com/FengZeng666/p/9726843.html
时间: 2024-10-11 21:21:48