Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma ...
分类:
其他好文 时间:
2017-12-02 11:13:43
阅读次数:
174
break the loop at the last node which pointed to the entry. Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove ...
分类:
编程语言 时间:
2017-12-02 11:08:46
阅读次数:
165
This was asked in LinkedIn Interview Given a list of child->parent relationships, build a binary tree out of it. All the element Ids inside the tree a... ...
分类:
其他好文 时间:
2017-12-02 00:33:13
阅读次数:
199
最近做项目遇到文件下载的问题,原本采用的是直接用一个href链接到需要下载的文件来处理这个问题,后来发现,如果文件是一个图片,浏览器会自动打开图片而不是下载,需要用户右击另存为才可以下载,很不友好,后来上网找了一个a标签的download属性,经测试,谷歌浏览器支持下载,但是IE并不支持这个属性,懒 ...
分类:
Web程序 时间:
2017-12-01 17:13:27
阅读次数:
229
题目: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note:A solution using O(n) spa ...
分类:
编程语言 时间:
2017-12-01 13:35:36
阅读次数:
143
mysql 主(master) 从(slave) 复制的原理: 1、 master将数据改变记录到二进制日志(binary log)中,也即是配置文件log-bin指定的文件(这些记录叫做二进制日志事件,binary log events) 2、 slave将master的binary log ev ...
分类:
数据库 时间:
2017-11-30 23:35:29
阅读次数:
248
这道题要判断一棵二叉树是否一棵二叉搜索树。二叉搜索树的定义是这样的: 它或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值; 若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值; 它的左、右子树也分别为二叉搜索树。 我一开始的做法是这 ...
分类:
其他好文 时间:
2017-11-30 23:27:33
阅读次数:
221
You need to find the largest value in each row of a binary tree. Example: 算法: 1.BFS。层级遍历,每层打擂台。 2.DFS。记录从上到下的深度,每层参数里传下去+1即可。(从下到上的深度是通过回传int返回值来递归实现的 ...
分类:
其他好文 时间:
2017-11-29 16:16:53
阅读次数:
138
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST' ...
分类:
其他好文 时间:
2017-11-29 16:11:21
阅读次数:
97
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For ...
分类:
其他好文 时间:
2017-11-28 21:51:32
阅读次数:
116