class Solution {private: vector nodes;public: void recoverTree(TreeNode *root) { nodes.clear(); dfs(root); // 1 5 3 4 2 6 7...
分类:
其他好文 时间:
2014-08-25 01:07:23
阅读次数:
329
No.1下图绿色区域的宽度为100%,其中有三个矩形,第一个矩形的宽度是200px,第二个和第三个矩形的宽度相等。请使用CSS3中的功能实现它们的布局。已知HTML结构是:column 1column 2column 3答案:.box{ width:100%; ...
分类:
其他好文 时间:
2014-08-24 22:01:33
阅读次数:
262
此文长期更新,具体根据我博客的样式判定.架构: BlackLowKey页面CSS:div.prob{ box-shadow:0 0 4px #ccf; padding: 2px; text-align:left; border-radius:6px;}div.prob h2{ font-s...
分类:
其他好文 时间:
2014-08-24 20:45:12
阅读次数:
231
1:css命名规范尽量把css模块化,不要把业务场景下css命名带进来,模块化之后可以复用,在模块外层加一个业务级的class,用于区分,一律小写;尽量用英文;不加下划线;尽量不缩写,除非一看就明白的单词.2:css书写顺序:浏览器加载渲染页面先加载dom,先渲染外层box,再渲染box自身宽高,浮...
分类:
Web程序 时间:
2014-08-24 20:42:32
阅读次数:
176
二分法变体,当查找到mid元素是空串时,同时向两边扩散寻找不为空串的索引作为mid,继续执行二分。public class Solution { public int search(String[] list, String str) { if (list == null || ...
分类:
其他好文 时间:
2014-08-24 14:09:32
阅读次数:
149
马上又要秋招了,赶紧复习下基础知识。这里复习下二叉树和图的深搜与广搜。从图的遍历说起,图的遍历方法有两种:深度优先遍历(Depth First Search), 广度优先遍历(Breadth First Search)。图搜索的经典应用走迷宫、N皇后、二叉树遍历等。遍历:定义按某种顺序访问“图”中所有的节点。...
分类:
其他好文 时间:
2014-08-24 12:58:32
阅读次数:
8475
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr...
分类:
其他好文 时间:
2014-08-24 11:37:02
阅读次数:
194