javascript---location.href/location.search/location.
分类:
编程语言 时间:
2014-08-25 11:43:24
阅读次数:
425
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
二分法变体,当查找到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