摘要: 1.单链表逆序实现1:遍历: 1: /* 2: * 遍历链表, 将每个结点的next置为其前驱 3: * 遍历过程中需要额外的指针来记录结点的前驱和后继 4: */ 5: LinkList ReverseList(LinkList L) 6: { 7: if (!L || !L->next) { 8: return L; 9: } 10: 11: Node *pre, *cur, *next; 12: 13: pre = next = NULL; 14: cur = L->next... 阅读全文
posted @ 2012-05-03 00:14 Newerth 阅读(6431) 评论(1) 推荐(2) 编辑