摘要: Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given bina... 阅读全文
posted @ 2016-03-08 22:00 背锅侠 阅读(141) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/AnnieKim/archive/2013/06/15/MorrisTraversal.html 阅读全文
posted @ 2016-03-08 21:30 背锅侠 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 快慢指针是链表中常用的技巧,反转链表也是常用算法之一。 使用p和q两个指针配合工作,使得两个节点间的指向反向,同时用r记录剩下的链表。p = head; q = head->next; head->next = NULL; 现在进入循环体,这是第一次循环。 r = q->nex... 阅读全文
posted @ 2016-03-08 19:59 背锅侠 阅读(166) 评论(0) 推荐(0) 编辑