随笔分类 -  Leetcode

摘要:Populating Next Right Pointers in Each NodeReversing linked list iteratively and recursively1) The iterative way:void reverse(Node*& head) { if (!head) return; Node* prev = NULL; Node* curr = head; while (curr) { Node* next = curr->next; curr->next = prev; prev = cur... 阅读全文
posted @ 2013-07-30 15:49 caniggia