自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Leetcode 分治&递归

1、Permutations 链接:https://leetcode.com/problems/permutations/ 思路一:交互数组中的两个数,递归实现 思路二: public List<List<Integer>> permute(int[] nums) { int length = nums.length; if(length == 0)

2017-01-13 21:23:40 453

原创 Leetcode 树遍历 应用

1、Binary Tree Maximum Path Sum 链接:https://leetcode.com/problems/binary-tree-maximum-path-sum/ 思路:递归,求左右子树深度,看深度差是否小于1 public boolean isBalanced(TreeNode root) { if(root == null)

2017-01-09 15:10:31 239

原创 leetcode 重建二叉树

1、Construct Binary Tree from Preorder and Inorder Traversal 链接:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 思路:根据先序遍历和中序遍历,重建树。递归思想,因为树节点不重复,先序的第一个为根,在中序的数

2017-01-08 22:24:21 713 1

原创 leetcode 树遍历变种

1、Sum Root to Leaf Numbers 链接:https://leetcode.com/problems/sum-root-to-leaf-numbers/ 思路:递归,改层的和 = 上层和* 10 +当前val public int sumNumbers(TreeNode root) { return sumDFS(root, 0); } p

2017-01-01 14:33:46 420

空空如也

空空如也

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

TA关注的人

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