发表于 http://liamchzh.0fees.net/?p=234&i=1 一次偶然的机会,发现python中list非常有意思。 先看一段代码 [py]array = [0, 0, 0]matrix = [array*3]print matrix## [[0,0,0,0,0,0,0,0,0] ...
分类:
编程语言 时间:
2016-08-30 20:59:58
阅读次数:
228
多条件排序可能有很多种思路,效率也各不相同,我的方法可能只适合自己用,毕竟目的是为了实现功能,所以采用了最笨的方法,不过效果还是很理想的,经过多次测试,6列1000行数据,平均排序时间大约是:28ms。 具体实现代码如下: 其中用到数组mergeSort()是自己定义到Array.prototype ...
分类:
编程语言 时间:
2016-08-30 19:38:00
阅读次数:
233
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? Analysis: Binary search: the first ...
分类:
其他好文 时间:
2016-08-30 13:25:34
阅读次数:
141
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 46858 Accepted: 24819 Description Given a two-dimensional array of positive and negative in ...
分类:
其他好文 时间:
2016-08-30 10:49:30
阅读次数:
107
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm ...
分类:
其他好文 时间:
2016-08-30 10:47:28
阅读次数:
123
<?php return array( //'配置项'=>'配置值' 'MODULE_ALLOW_LIST' => array('Home'), 'DEFAULT_MODULE' => 'Home', // 默认模块 'APP_URL' => 'http://app.weilan.com', 'VI ...
分类:
其他好文 时间:
2016-08-30 10:46:10
阅读次数:
167
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num ...
Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return ...
分类:
其他好文 时间:
2016-08-30 07:05:37
阅读次数:
134
自定义函数function.yangA.php页面采用插件形式调用<?php
/*
*文件名
*function.函数名.phpfunction.yangA.php
*声明的函数名规则
*smarty_function_函数名()smarty_function_yangA
*参数
*1.数组array
*2.smarty
*模板使用
*<{yangAcontent="IamMr.Yang"color="red"size..
分类:
Web程序 时间:
2016-08-29 20:53:34
阅读次数:
193
javascript的几种基本类型: 我看到网上一篇文章说是typeof无法判断function,可是为什么我试验了一下是可以判断的呢?不懂,欢迎各位看到有什么问题可以留言哦 array:typeof无法判断array倒确实,用Obeject.prototype.toString.call() nu ...
分类:
Web程序 时间:
2016-08-29 14:31:06
阅读次数:
163