Given amxnmatrix, if an element is 0, set its
entire row and column to 0. Do it in place.click to show follow up.Follow up:Did
you use extra space?A s...
分类:
其他好文 时间:
2014-05-12 08:22:51
阅读次数:
255
function fireEvent(element, event) { if
(document.createEventObject) { var evt = document.createEventObject(); ...
分类:
编程语言 时间:
2014-05-12 06:12:47
阅读次数:
367
STL库中实现了nth_element函数,实现的功能是 “返回n个元素中的第k小的元素”。
首先,头脑风暴一下“返回n个元素中的第k小的元素”的算法:
1
排序 ,首选快排 O(n*logn),取出第k个即可。
2
其次,是维护一个大小为k的数组,找出数组中的最大值kmax,然后依次遍历剩下的 n-k 个元素,如果小雨kmax,则替换掉kmax
元素,然后再...
分类:
其他好文 时间:
2014-05-11 07:35:46
阅读次数:
250
Triangle
Time Limit: 3000MS
Memory Limit: 30000K
Total Submissions: 8038
Accepted: 2375
Description
Given n distinct points on a plane, your task is to find the triangl...
分类:
其他好文 时间:
2014-05-11 06:36:44
阅读次数:
425
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Single Number II
Total Accepted: 14224 Total
Submissions: 43648
Given an array of integers, every element appears three ti...
分类:
其他好文 时间:
2014-05-11 03:54:46
阅读次数:
317
题目
Given a binary tree, find the maximum path sum.
The path may start and end at any node in the tree.
For example:
Given the below binary tree,...
分类:
其他好文 时间:
2014-05-11 03:25:24
阅读次数:
298
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Maximum Depth of Binary Tree
Total Accepted: 16605 Total
Submissions: 38287
Given a binary tree, find its maximum depth.
...
分类:
其他好文 时间:
2014-05-11 01:58:31
阅读次数:
441
find命令小结find命令用于在系统中查找文件,配合 -exec 选项或
xargs命令还能对查找到得文件执行一些列的自动化操作。基本格式:find [-H] [-L] [-P] [path...]
[expression]path指定起始搜索路径,可以指定多个,exprssion表示搜索表达式,...
分类:
其他好文 时间:
2014-05-10 06:53:44
阅读次数:
324
Jump Game Given an array of non-negative
integers, you are initially positioned at the first index of the array. Each
element in the array represents ...
分类:
其他好文 时间:
2014-05-10 03:13:50
阅读次数:
481
原题地址:http://oj.leetcode.com/problems/single-number-ii/题意:Given
an array of integers, every element appearsthreetimes except for one. Find that
single ...
分类:
编程语言 时间:
2014-05-10 03:01:41
阅读次数:
413