码迷,mamicode.com
首页 >  
搜索关键字:python实现    ( 3105个结果
leetcode 【 Find Peak Element 】python 实现
题目: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
leetcode 【 Majority Element 】python 实现
题目: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
leetcode 【 Maximum Subarray 】python 实现
题目: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
leetcode 【 Merge Sorted Array 】python 实现
题目: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/
【转载】Python 实现的随机森林http://lidandan1314.diandian.com/
分类:编程语言   时间:2015-01-20 00:45:45    阅读次数:264
python实现利用nmap和爱站扫描开放80端口的IP并进行反向域名解析
#!/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
leetcode 【 Rotate Image 】python 实现
题目: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
Apriori算法及python实现
1 Apriori介绍Apriori算法使用频繁项集的先验知识,使用一种称作逐层搜索的迭代方法,k项集用于探索(k+1)项集。首先,通过扫描事务(交易)记录,找出所有的频繁1项集,该集合记做L1,然后利用L1找频繁2项集的集合L2,L2找L3,如此下去,直到不能再找到任何频繁k项集。最后再在所有的频...
分类:编程语言   时间:2015-01-18 22:31:13    阅读次数:280
leetcode 【 Pascal's Triangle II 】python 实现
题目: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
leetcode 【 Pascal's Triangle 】python 实现
题目: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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!