41、入一个递增排序的数组和一个数字S,在数组中查找两个数,是的他们的和正好是S,如果有多对数字的和等于S,输出两个数的乘积最小的。 42、小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100 ...
分类:
其他好文 时间:
2017-04-04 22:58:12
阅读次数:
224
Java通过Executors提供四种线程池,分别为:newCachedThreadPool创建一个可缓存线程池,如果线程池长度超过处理需要,可灵活回收空闲线程,若无可回收,则新建线程。newFixedThreadPool 创建一个定长线程池,可控制线程最大并发数,超出的线程会在队列中等待。newS ...
分类:
编程语言 时间:
2017-04-04 13:18:17
阅读次数:
243
server数据库中raiserror的作用就和asp.NET中的throw new Exception一样,用于抛出一个异常或错误。这个错误可以被程序捕捉到。 raiserror的常用格式如下:raiserror('错误的描述',错误的严重级别代码,错误的标识,错误的描述中的参数的值(这个可以是多 ...
分类:
数据库 时间:
2017-04-02 20:00:41
阅读次数:
211
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- ...
分类:
其他好文 时间:
2017-04-01 23:09:02
阅读次数:
220
var list = new List { new Model { Id = 1, UserName = "张三", Password = "123456", Email = "zhang3@yoy.com"}, new Model { Id = 2, UserName = "李四", Passwo... ...
分类:
其他好文 时间:
2017-04-01 17:54:13
阅读次数:
196
python基础作业 1.执行python脚本的两种方法 脚本前面直接指定解释器 在脚本开始前声明解释器 2.简述位,字节的关系 每一个字节占用八个比特位 3, 简述ascii、unicode、utf- ‐8、gbk的关系 utf-‐8 <-- unicode <-- gbk <-- ascii ...
分类:
编程语言 时间:
2017-03-31 23:44:26
阅读次数:
328
110. Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a bin ...
分类:
其他好文 时间:
2017-03-31 20:51:58
阅读次数:
133
1、查找字符位置函数strpos($str,search,[int]):查找search在$str中的第一次位置从int开始;stripos($str,search,[int]):函数返回字符串在另一个字符串中第一次出现的位置。该函数对大小写不敏感strrpos($str,search,[int])... ...
分类:
其他好文 时间:
2017-03-31 19:11:32
阅读次数:
181
1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wo ...
分类:
其他好文 时间:
2017-03-31 16:42:08
阅读次数:
338
/*1003. 我要通过!(20)“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:1. 字符串中必须仅有P, A, T这三种字符,不可以包含其它字符;2. ...
分类:
其他好文 时间:
2017-03-31 15:40:55
阅读次数:
125