2016年8月7日

SubTree

摘要: You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of 阅读全文

posted @ 2016-08-07 17:33 Sheryl Wang 阅读(148) 评论(0) 推荐(0) 编辑

Odd Even Linked List

摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文

posted @ 2016-08-07 11:18 Sheryl Wang 阅读(121) 评论(0) 推荐(0) 编辑

Partition Array by Odd and Even

摘要: Partition an integers array into odd number first and even number second. 剑指offer的一道题,把所有奇数移动到偶数前面,其实是partition的双端解法,利用双指针。先检测两边合格的元素,都不合格,则交换,继续。 需要注 阅读全文

posted @ 2016-08-07 11:03 Sheryl Wang 阅读(191) 评论(0) 推荐(0) 编辑

导航