import random
def rand(n):
for i in range(n):
yield random.randint(0,1000)
#创建一个随机数列表
def createList(n):
lists=[]
for i in rand(n):
lists.append(i)
return lists
#挖坑法快速排...
分类:
编程语言 时间:
2014-10-14 15:13:48
阅读次数:
211
递归:class Solution: # @param candidates, a list of integers # @param target, integer # @return a list of lists of integers def combinationS...
分类:
其他好文 时间:
2014-10-14 14:38:48
阅读次数:
148
https://oj.leetcode.com/problems/search-in-rotated-sorted-array/一个被旋转的数组,要求二分搜索查询一个数。修改二分搜索可以完成。注意可以通过A[l]A[r]时,中间有一个间断点。可以通过A[mid]>A[r]来判断中点与旋转中心的位置关...
分类:
编程语言 时间:
2014-10-14 05:02:17
阅读次数:
222
JOS 不能进入lab2 问题的解决
这个鸟问题折腾了我好久!
lab2是需要 kern/pmap.c的!但是这里没有
首先要git checkout -b lab2 origin/lab2
(只要做好上面这一步,就可以确保能够调整好文件了,坑啊!到现在都6个小时不止了!)
接着git fetch
然后git merge...
分类:
其他好文 时间:
2014-10-14 02:51:08
阅读次数:
181
for branch_name in `git branch | grep b_`do git rm -f README.md git commit -m'rm README.md' git merge $branch_name git rm -f README.md ...
分类:
其他好文 时间:
2014-10-14 00:37:37
阅读次数:
239
继续畅通工程
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 14309 Accepted Submission(s): 6228
Problem Description
省政府“畅通工程”的目标是使全省任何两个村庄...
分类:
其他好文 时间:
2014-10-13 19:12:57
阅读次数:
230
1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { 7 * ...
分类:
其他好文 时间:
2014-10-13 13:30:09
阅读次数:
118
本篇文章主要介绍storm的关键概念!(翻译摘取至徐明明博客)This page lists the main concepts of Storm and links to resources where you can find more information. The concepts dis...
分类:
其他好文 时间:
2014-10-12 23:35:39
阅读次数:
417
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is now [1,1,2,...
分类:
其他好文 时间:
2014-10-12 19:42:38
阅读次数:
141
来自stackoverflow的题目Why is processing a sorted array faster than an unsorted array?...
分类:
编程语言 时间:
2014-10-12 18:15:58
阅读次数:
296