上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: Given 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 阅读全文
posted @ 2016-10-12 05:49 微微程序媛 阅读(109) 评论(0) 推荐(0)
摘要: Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. You may assume each number in the seq 阅读全文
posted @ 2016-10-12 04:17 微微程序媛 阅读(147) 评论(0) 推荐(0)
摘要: Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in 阅读全文
posted @ 2016-10-11 08:44 微微程序媛 阅读(128) 评论(0) 推荐(0)
摘要: You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos 阅读全文
posted @ 2016-10-11 08:43 微微程序媛 阅读(156) 评论(0) 推荐(0)
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2016-10-11 08:39 微微程序媛 阅读(114) 评论(0) 推荐(0)
摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should 阅读全文
posted @ 2016-10-11 08:37 微微程序媛 阅读(135) 评论(0) 推荐(0)
摘要: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti 阅读全文
posted @ 2016-10-11 08:36 微微程序媛 阅读(158) 评论(0) 推荐(0)
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文
posted @ 2016-10-11 08:34 微微程序媛 阅读(168) 评论(0) 推荐(0)
摘要: DFS : depth first search BFS: breadth first search DFS : 46. Permutations Given a collection of distinct numbers, return all possible permutations. Fo 阅读全文
posted @ 2016-10-04 03:55 微微程序媛 阅读(160) 评论(0) 推荐(0)
摘要: Binary Search 模版 四种结构 阅读全文
posted @ 2016-10-02 05:37 微微程序媛 阅读(127) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页