摘要: Flatten Binary Tree to Linked ListOct 14 '12Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ 3 \ 4 \ 5... 阅读全文
posted @ 2012-12-25 01:36 西施豆腐渣 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algorithm should use only constant space. You maynotmodify the values in the list, only nodes itself can be changed.keypoints:1, head is 阅读全文
posted @ 2012-12-25 00:11 西施豆腐渣 阅读(126) 评论(0) 推荐(0) 编辑