码迷,mamicode.com
首页 >  
搜索关键字:partition by range    ( 12244个结果
python输出乘法口诀
for i in range(1,10): for j in range(1,i+1): print (" ".join(["%d*%d=%d" %(j,i,i*j)]))[root@miller qinbin]# python test.py 1*1=11*2=2 2*2=41*3=3 2...
分类:编程语言   时间:2014-05-26 20:34:16    阅读次数:388
[LeetCode] [Partition List 2012-04-30]
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o...
分类:其他好文   时间:2014-05-26 09:35:28    阅读次数:266
快速排序
快速排序也利用了分治的思想,跟归并排序排序相比减少了交换次数int partition(int a[],int p,int r){ int x = a[r]; int i = p-1; int j; for(j = p;j<r;j++) { if(a[j]...
分类:其他好文   时间:2014-05-26 02:47:46    阅读次数:226
表达式计算(re运用)
import reex=raw_input()num="1234567890"a=re.findall("\d+",ex)b=re.findall("[+-]",ex)l=[]if len(a)==len(b): for i in range(len(a)): l.append(...
分类:其他好文   时间:2014-05-26 01:47:32    阅读次数:296
Validation.Add();Excel
Irange = (Microsoft.Office.Interop.Excel.Range)worksheet.get_Range("I1", "I1").get_Resize(100, 1);//获取一整列I,行数为100Irange.Validation.Add(Microsoft.Offic...
分类:其他好文   时间:2014-05-25 02:21:42    阅读次数:293
Python重写C语言程序100例--Part8
''' 【程序61】 题目:打印出杨辉三角形(要求打印出10行如下图)    1.程序分析: ''' if __name__ == '__main__': a = [] for i in range(10): a.append([]) for j in range(10): a[i].append(0) for i...
分类:编程语言   时间:2014-05-25 00:52:00    阅读次数:436
趣味编程:静夜思(Java8版)
import java.util.stream.*; class KV{ String ch; int id; } public class Test { private static void print(String text, int offset) { IntStream.range(0, text.length()) .mapToObj(i -> new KV(){{c...
分类:编程语言   时间:2014-05-24 22:09:03    阅读次数:363
LeetCode——Palindrome Partition
Palindrome Partitioning   Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "...
分类:其他好文   时间:2014-05-24 14:29:45    阅读次数:222
Python重写C语言程序100例--Part10
''' 【程序81】 题目:809*??=800*??+9*??+1 其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。 1.程序分析: 2.程序源代码 这个程序实在是奇怪 0 = 1 :( 就写个程序而已,不去追究了 ''' a = 809 for i in range(10,100): b = i * a + 1 ...
分类:编程语言   时间:2014-05-24 14:15:21    阅读次数:321
Nginx是如何实现轻量级和高并发
Linux系统通过软限制和硬限制,制约了打开文件的最大个数,而且每个端口侦听的连接数受限于/etc/sytctl.conf中的ip_local_port_range的范围,那么nginx是如何做到轻量级和高并发的。      Nginx的进程模型            各个work进程间通过accept_mutex互斥锁进行连接的获取,以防止惊群现象的发生(即所有进程都收到通知,却...
分类:其他好文   时间:2014-05-22 17:11:39    阅读次数:364
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!