原题地址:https://oj.leetcode.com/problems/n-queens/题意:经典的N皇后问题。解题思路:这类型问题统称为递归回溯问题,也可以叫做对决策树的深度优先搜索(dfs)。N皇后问题有个技巧的关键在于棋盘的表示方法,这里使用一个数组就可以表达了。比如board=[1,
...
分类:
编程语言 时间:
2014-05-26 10:07:52
阅读次数:
274
I hate windows. 1. 下载安装 ImageMagick,
选择合适您电脑的版本,我下载的是:
ImageMagick-6.8.9-1-Q16-x86-dll.exehttp://www.imagemagick.org/script/binary-releases.php#window...
Given an array S of n integers, find three
integers in S such that the sum is closest to a given number, target. Return the
sum of the three integers....
分类:
其他好文 时间:
2014-05-26 09:58:20
阅读次数:
220
1.PHP和js同样是弱类型的语言 字符串的截取php中: $str ="hello world!";
substr($str,1,2);//从字符串的下标为1的地方截取2个字符, eljs中 var str = "hello world!";
str.substring(1,2);//e ...
分类:
其他好文 时间:
2014-05-26 09:55:57
阅读次数:
243
Given an unsorted integer array, find the first
missing positive integer.For
example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-05-26 09:43:14
阅读次数:
220
Given an array S of n integers, are there
elements a, b, c, and d in S such that a + b + c + d = target? Find all unique
quadruplets in the array whic...
分类:
其他好文 时间:
2014-05-26 09:42:30
阅读次数:
209
session问题集锦
对于PHP的session功能,始终找不到合适的答案,尤其是一些错误,还有一些没有错误的结果,最可怕的就是后者,一直为许多的初学者为难。就连有些老手,有时都被搞得莫名其妙。本文,将这些问题,做一个简单的汇总,以便大家查阅。1.错误提示Warning:
Cannot sen.....
分类:
其他好文 时间:
2014-05-26 09:41:55
阅读次数:
236
使用PHP的cURL库可以简单和有效地去抓网页,您只需要运行一个脚本,然后分析一下您所抓取的网页,然后就可以以程序的方式得到您想要的数据了。无论是您想从一个链接上取部分数据,或是取一个XML文件并把其导入数据库,哪怕就是简单的获取网页内容,cURL是一个功能强大的PHP库。本文主要讲述如果使用这个P...
分类:
Web程序 时间:
2014-05-26 09:40:36
阅读次数:
315
变量定义(variables):local: time or _time instance:
@time class: @@time global $time数据类型(data types)Numeric String Symbol Boolean
Array Hashvariabl...
分类:
其他好文 时间:
2014-05-26 09:39:54
阅读次数:
217
mysqlnd成为php 5.3中的默认mysql驱动,它有如下优点:mysqlnd更容易编译:
因为它是php源码树的一个组成部分mysqlnd和php内部机制结合更紧密,是优化过的mysql驱动mysqlnd更节省内存,从测试结果来看,比传统的mysql扩展节省40%的内存mysqlnd更快my...
分类:
数据库 时间:
2014-05-26 09:31:45
阅读次数:
260