Heqianqian的博客

盛年不再有,一日难再晨,及时当勉励,岁月不待人.

LeetCode BackPack 背包问题

//从上个月末之后就开始有点浮躁起来,本来计划国庆查漏补缺v.22bd 的,结果网卡光荣的坏了ORZ……无论如何,OFFER现在还没有拿到,即便是拿到了也不该放松学习的状态。Stay Hungry,Stay Foolish背包问题是动态规划的经典问题,LeetCode上有五种背包的变种问题,现...

2017-10-03 22:36:03

阅读数 8174

评论数 4

LeetCode Invert Binary Tree 翻转二叉树

题目描述:Invert a binary tree.样例输入输出: 1 1 / \ / \ 2 3 => 3 2 / \ 4 4解法一: 递归实现private void invertRecursion(Tre...

2017-09-13 10:24:02

阅读数 269

评论数 0

LeetCode Identical Binary Tree 相同二叉树

题目描述:Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same ...

2017-09-13 10:03:14

阅读数 254

评论数 0

LeetCode Flatten Binary Tree to Linked List 将二叉树展开成链表

题目描述:Flatten a binary tree to a fake “linked list” in pre-order traversal. Here we use the right pointer in TreeNode as the next pointer in ListNode...

2017-09-13 09:33:05

阅读数 786

评论数 0

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