算法
fang92
这个作者很懒,什么都没留下…
展开
-
快排
一个快排好多问题原创 2014-11-05 09:50:14 · 462 阅读 · 0 评论 -
二叉树遍历-----前序后序迭代遍历的新思路
leetcode二叉树遍历 前序遍历:https://leetcode.com/problems/binary-tree-preorder-traversal/ 中序遍历:https://leetcode.com/problems/binary-tree-inorder-traversal/ 后序遍历:https://leetcode.com/problems/binary-tree-pos原创 2015-09-04 17:29:43 · 454 阅读 · 0 评论 -
一个二维矩阵,里面只有0和1,问怎样求指定某一个格与它数字相同的连通格子个数
一个二维矩阵,里面只有0和1,问怎样求指定某一个格与它数字相同的连通格子个数 记录一下 感觉效率不高 int iter(int x, int y, vector>& nums, vector>& dp){ int lenX = nums.size(); int lenY = nums[0].size(); if (x = lenX || y = lenY)原创 2016-03-18 11:08:22 · 4356 阅读 · 0 评论