上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 43 下一页

2015年10月4日

119. Pascal's Triangle II (Graph; WFS)

摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use... 阅读全文

posted @ 2015-10-04 15:43 joannae 阅读(134) 评论(0) 推荐(0) 编辑

118. Pascal's Triangle (Array)

摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return 阅读全文

posted @ 2015-10-04 15:27 joannae 阅读(184) 评论(0) 推荐(0) 编辑

127. Word Ladder (Tree, Queue; WFS)

摘要: Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, 阅读全文

posted @ 2015-10-04 15:21 joannae 阅读(362) 评论(0) 推荐(0) 编辑

117. Populating Next Right Pointers in Each Node II (Tree; WFS)

摘要: 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 stil... 阅读全文

posted @ 2015-10-04 14:58 joannae 阅读(167) 评论(0) 推荐(0) 编辑

116. Populating Next Right Pointers in Each Node (Tree; WFS)

摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文

posted @ 2015-10-04 14:54 joannae 阅读(173) 评论(0) 推荐(0) 编辑

107. Binary Tree Level Order Traversal II(Tree, WFS)

摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For ... 阅读全文

posted @ 2015-10-04 14:49 joannae 阅读(169) 评论(0) 推荐(0) 编辑

106. Construct Binary Tree from Inorder and Postorder Traversal (Tree; DFS)

摘要: Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.struct TreeNod... 阅读全文

posted @ 2015-10-04 14:33 joannae 阅读(145) 评论(0) 推荐(0) 编辑

105. Construct Binary Tree from Preorder and Inorder Traversal (Tree; DFS)

摘要: Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.class Solution ... 阅读全文

posted @ 2015-10-04 14:24 joannae 阅读(147) 评论(0) 推荐(0) 编辑

101. Symmetric Tree (Tree, Queue; DFS, WFS)

摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / \ 2 2 / 阅读全文

posted @ 2015-10-04 14:11 joannae 阅读(301) 评论(0) 推荐(0) 编辑

95. Unique Binary Search Trees II (Tree; DFS)

摘要: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return al 阅读全文

posted @ 2015-10-04 12:22 joannae 阅读(286) 评论(0) 推荐(0) 编辑

上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 43 下一页

导航