自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 Restore IP Addresses

题目:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]

2014-04-16 15:24:26 449

原创 Longest Repeated Sequence

题目:

2014-04-07 15:10:52 650

原创 Decode Ways

题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the t

2014-04-07 14:44:42 443

原创 Minimum Depth of Binary Tree

题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

2014-04-04 15:53:42 418

原创 Palindrome Partitioning

题目:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return

2014-04-04 12:44:51 585

原创 Path Sum II

题目:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.算法思想:递归

2014-04-03 22:57:19 439

原创 Binary Tree Level Order Traversal II

题目: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).算法思想:1,首先想到的是递归,对于一个结点,将左子树和右子树返回的结果合并起来,再加上根结

2014-04-03 14:39:39 650

原创 Binary Tree Preorder Traversal(迭代写法)

题目:Given a binary tree, return the preorder traversal of its nodes' values.算法思想:参见点击打开链接vector preorderTraversal(TreeNode *root) { TreeNode *p = root; stack record; vector r

2014-04-02 22:30:33 899

原创 Binary Tree Postorder Traversal(迭代写法)

题目:Given a binary tree, return the postorder traversal of its nodes' values.算法思想:迭代求一个二插树的后序遍历,首先得从根结点找到后序遍历输出的第一个结点(称“最左节点”),而且必须将这个过程中的所有结点记录下来(因为不能从儿子结点找到父结点),由于后入先出,所以选择栈记录,大体过程如下面步骤:1.从根结点开

2014-04-02 22:08:51 623

原创 Palindrome Partitioning II

题目:Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",

2014-04-01 14:49:48 453

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除