码迷,mamicode.com
首页 >  
搜索关键字:lists    ( 2473个结果
Search a 2D Matrix【python】
class Solution: # @param matrix, a list of lists of integers # @param target, an integer # @return a boolean def searchMatrix(self, matrix...
分类:编程语言   时间:2014-08-28 11:24:19    阅读次数:216
Permutations【python】
class Solution: # @param num, a list of integer # @return a list of lists of integers def permute(self, num): length=len(num) i...
分类:编程语言   时间:2014-08-27 20:11:28    阅读次数:200
LeetCode总结 -- 一维数据合并篇
合并是一维数据结构中很常见的操作, 通常是排序, 分布式算法中的子操作。 这篇总结主要介绍LeetCode中关于合并的几个题目: Merge Two Sorted ListsMerge Sorted ArraySort ListMerge k Sorted Lists我们先来看看两个有序一维数据的合并, 这里主要是要介绍链表的合并操作, 不过因为一维数组的合并也比较简单, 而且与链表有比较性, 就...
分类:其他好文   时间:2014-08-27 12:59:07    阅读次数:348
Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路: 1 cla...
分类:其他好文   时间:2014-08-25 18:38:04    阅读次数:211
C#快速排序详解
使用快速排序法对一列数字进行排序的过程快速排序使用分治法(Divide and conquer)策略来把一个序列(list)分为两个子序列(sub-lists)。步骤为:从数列中挑出一个元素,称为 "基准"(pivot),重新排序数列,所有元素比基准值小的摆放在基准前面,所有元素比基准值大的摆放在基...
分类:其他好文   时间:2014-08-25 03:24:23    阅读次数:228
排序算法分析【六】:快速排序(附Python&C++代码)
快速排序是由东尼·霍尔所发展的一种排序算法。在平均状况下,排序 n 个项目要Ο(n log n)次比较。在最坏状况下则需要Ο(n2)次比较。 快速排序使用分治法(Divide and conquer)策略来把一个串行(list)分为两个子串行(sub-lists)。 步骤为: 从数列中挑出一个元素,称为 "基准"(pivot),重新排序数列,所有元素比基准值小的摆放在基准前面,所有元...
分类:编程语言   时间:2014-08-23 23:03:11    阅读次数:485
【Leet Code】Add Two Numbers
Add Two Numbers  Total Accepted: 20255 Total Submissions: 88115My Submissions You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a...
分类:其他好文   时间:2014-08-23 21:40:01    阅读次数:200
python使用 db.select 返回的数据只能遍历一次
python中通过find从mongo中查出的数据,或者通过select返回的数据,其实返回的是游标,当你进行便利一次之后,游标指向最后,所以当你再一次进行便利时,便出现数据为空的现象。解决办法:通过list()进行数据的强制转换lists = list(mongo中返回的数据)但是这样又会出现新的...
分类:数据库   时间:2014-08-23 15:21:20    阅读次数:245
第一次独立完成puppet脚本编写
利用puppet管理solrcloud主脚本1./etc/puppet/manifests/zookeeper.pp/*vimset:expandtab:shiftwidth=4:tabstop=4:smarttab:*/#=globalvar#=sae#=cron#=user#=account#=stdlib#=zookeeper#=solr#=jettynode/sae$/{includeglobalvarincludeglobalvar::userincludeaccount::lists..
分类:其他好文   时间:2014-08-22 18:08:09    阅读次数:327
phpcms分页用法简介
PHPCMS分页的用法前面需要有引用的list,代码如下:{pc:content action="lists" catid="11" order="id DESC" thumb="" moreinfo="" page="$page" num="4" cache="3600" } {loop $...
分类:Web程序   时间:2014-08-21 18:45:54    阅读次数:281
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!