码迷,mamicode.com
首页 >  
搜索关键字:php array 数组    ( 182180个结果)
leetcode——Two Sum 两数之和(AC)
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:其他好文   时间:2014-06-09 23:14:45    阅读次数:264
并查集—分离集合森林实现
并查集总结    今天总结一下并查集,这个完了之后,寒假学的数据结构基础的模板类的题目差不多就完了,对于模板题,敲上10遍、20遍、30遍,那么模板 就不是模板,就成为了你自己的东西,就好像 A+B 一辈子也忘不了,以后每天敲一遍模板题,加深对模板的理解。 并查集,一般使用的是 数组实现、树实现,其中数组实现时间复杂度较高,树实现也就是分离集合森林 查找、合并的时间复杂度不会...
分类:其他好文   时间:2014-06-09 23:14:04    阅读次数:204
LAMP 安装详解
1. LAMP 的安装 sudo apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql 2. 由于LAMP大部分操作与/var/www目录相关,为了方便,修改该目录的权限为普通用户可访问。 sudo chmod 777 /var/www/ 3...
分类:其他好文   时间:2014-06-08 18:00:11    阅读次数:313
php用类生成二维码
百度云盘里面已经有了,引用生成二维码类,制作和验证码的制作一球样...
分类:Web程序   时间:2014-06-08 17:53:30    阅读次数:239
ACM-树状数组之Stars——hdu1541,poj2352
ACM 树状数组 Stars hdu1541 poj2352...
分类:其他好文   时间:2014-06-08 16:52:38    阅读次数:186
转换MFC CString 到std::string
std::string CStringToSTDStr(const CString& theCStr) { // Convert the CString to a regular char array const int theCStrLen = theCStr.GetLength(); char *buffer = (char*)malloc(sizeof(char)*(theCStrLe...
分类:其他好文   时间:2014-06-08 16:33:53    阅读次数:218
POJ 2965 The Pilots Brothers' refrigerator (DFS)
题目:http://poj.org/problem?id=2965 也是以前就做过的题目,这次居然遇到了问题搞了一天。 关于最小步骤很容易就出来,DFS就可以,但是每一步是什么怎么也出不来了 DFS本质就是利用栈暴力,当出现正确结果的时候其过程都在栈中,我一直努力想还原这个栈,未果 然后思路大乱,然后问了RE,才发现根本不用这么麻烦,只需要建个存储步骤数组,在改变元素的时候记录并不停更新就...
分类:其他好文   时间:2014-06-08 14:51:49    阅读次数:242
检查输入的用户名是否符合规定
代码清单: <?php /** * 检测输入中是否含有错误字符 * @author ruxing.li * @param char $string 要检查的字符串名称 * @return boolean */ function is_badword($string) { $badwords = array("\\",'&',' ',"'",'"','/','*',',',''...
分类:其他好文   时间:2014-06-08 14:49:48    阅读次数:288
PHP 数组函数
php常用数组函数...
分类:Web程序   时间:2014-06-08 14:48:36    阅读次数:302
判断字符串是否为 utf-8 编码
代码清单: <?php /** * 判断字符串是否为utf8编码,英文和半角字符返回ture * @author ruxing.li * @param $string * @return bool */ function is_utf8($string) { return preg_match('%^(?: [\x09\x0A\x0D\x...
分类:其他好文   时间:2014-06-08 10:47:58    阅读次数:267
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!