2014-04-28
23:28题目:给定一个数字,用英语把它读出来。解法:ZOJ上有相反的题目。如果我要用中文读书来呢?代码: 1 // 17.7 Read an integer
in English. 2 #include 3 #include 4 using namespace s...
分类:
其他好文 时间:
2014-04-29 15:29:44
阅读次数:
423
假设cshtml文件中是这样的:data是json数据。传递到的Action是/Home/MyAjax。那么在Action方法处接收的方式如下:public
ActionResult MyAjax(string val1) { string val2 = Requ...
分类:
Web程序 时间:
2014-04-29 15:21:36
阅读次数:
564
2014-04-29
00:04题目:给定一个整数数组,找出所有加起来为指定和的数对。解法1:可以用哈希表保存数组元素,做到O(n)时间的算法。代码: 1 // 17.12
Given an array of integers and target value, find all pairs in ...
分类:
其他好文 时间:
2014-04-29 15:08:13
阅读次数:
469
Binary String Matching时间限制:3000ms |
内存限制:65535KB难度:3描述Given two strings A and B, whose alphabet consist only ‘0’ and
‘1’. Your task is only to tell ho...
分类:
其他好文 时间:
2014-04-29 15:02:00
阅读次数:
564
1. ReferenceTable overflow (max=512)
内存泄露,程序运行一段时间就挂掉了.在利用反射调用java中的函数需要释放掉查找到的类voidpublishJavaProgress(JNIEnv*env,jobjectobj,jintprogress){jclassclaz...
分类:
其他好文 时间:
2014-04-29 14:46:40
阅读次数:
411
2014-04-29
01:02题目:从m个整数里随机选出n个整数,要求等概率。解法:和洗牌的算法类似,每次随机抽出一个数,抽n次即可。时间复杂度O(m *
n),空间复杂度O(m)。代码: 1 // 18.3 pick m integers randomly from an array of n ...
分类:
其他好文 时间:
2014-04-29 14:42:32
阅读次数:
345
I had been waiting for the latest MySQL
connector for .NET to come out so I can move on to the new and sleek Visual
Studio 2012 for my projects. Found...
分类:
数据库 时间:
2014-04-29 14:17:54
阅读次数:
753
php使用array_rand()函数从数组中随机选择一个或多个元素的方法。使用array_rand()
函数从数组中随机选出一个或多个元素,并返回。array_rand(array,number)参数 描述array 必需。规定输入的数组参数。
www.jbxue.comnumber 可选。默认是...
分类:
Web程序 时间:
2014-04-29 14:08:44
阅读次数:
651
PHP自定义函数只允许用return语句返回一个值,当return执行以后,整个函数的运行就会终止。有时要求函数返回多个值时,用return是不可以把值一个接一个地输出的。return语句可以返回任何类型的变量,这就是使自定义函数返回多个值的关键。代码:输出结果:Array(
[0] => The....
分类:
Web程序 时间:
2014-04-29 14:07:43
阅读次数:
577
接触php这么久了,也就用过三种排序,冒泡排序,快速排序,木桶排序,今天就来学习一下冒泡排序:那么什么是冒泡排序,就像河里的气泡一样,一个一个的气泡浮出水面,而这里是一个一个的数字,他的原理是重复的走访(遍历)要排序的数列,比较相邻的两个数,把大的数移到右边,接着遍历,直到所有数完成从小到大的顺序。...
分类:
Web程序 时间:
2014-04-29 14:01:30
阅读次数:
571