题目:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its ind...
分类:
编程语言 时间:
2015-01-23 00:42:53
阅读次数:
277
题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the ...
分类:
编程语言 时间:
2015-01-22 17:31:28
阅读次数:
159
题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2...
分类:
编程语言 时间:
2015-01-22 01:43:10
阅读次数:
198
题目:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or eq...
分类:
编程语言 时间:
2015-01-21 23:53:45
阅读次数:
175
【转载】Python 实现的随机森林http://lidandan1314.diandian.com/
分类:
编程语言 时间:
2015-01-20 00:45:45
阅读次数:
264
#!/usr/bin/python
# -*- coding: utf-8 -*-
from libnmap.process import NmapProcess
from libnmap.parser import NmapParser
import requests
x=90
while x < 255:
print "\033[1;31mstart 118.192.%s.0/24\033...
分类:
编程语言 时间:
2015-01-19 10:56:44
阅读次数:
535
题目:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?代码:oj测试通过Runtime...
分类:
编程语言 时间:
2015-01-18 23:59:42
阅读次数:
467
1 Apriori介绍Apriori算法使用频繁项集的先验知识,使用一种称作逐层搜索的迭代方法,k项集用于探索(k+1)项集。首先,通过扫描事务(交易)记录,找出所有的频繁1项集,该集合记做L1,然后利用L1找频繁2项集的集合L2,L2找L3,如此下去,直到不能再找到任何频繁k项集。最后再在所有的频...
分类:
编程语言 时间:
2015-01-18 22:31:13
阅读次数:
280
题目:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onl...
分类:
编程语言 时间:
2015-01-18 22:30:51
阅读次数:
291
题目:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4...
分类:
编程语言 时间:
2015-01-16 23:45:10
阅读次数:
2605