本次内容:异常机制1、为什么需要异常2、异常3、error类4、exception类5、exception类中的unchecked
exception 举例:6、常用异常处理方法a.try注意:一个try语句块至少得带一个finally语句块或catch语句块 1 package
array; 2....
分类:
编程语言 时间:
2014-05-12 16:17:54
阅读次数:
406
Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given[100, 4,
200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-05-10 20:06:26
阅读次数:
404
一、数组于简单排序 数组
数组(array)是相同类型变量的集合,可以使用共同的名字引用它。数组可被定义为任何类型,可以是一维或多维。数组中的一个特别要素是通过下标来访问它。数组提供了一种将有联系的信息分组的便利方法。
一维数组 一维数组(one‐dimensional array )实质...
分类:
编程语言 时间:
2014-05-06 09:16:37
阅读次数:
383
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-06 00:51:29
阅读次数:
353
和上一题差不多,都是用最大流来做,可是有人能告诉我STL和直接用数组,真的有那么大区别吗?STL超时,数组0ms,这是什么数据,有那么叼吗附上两份代码!希望过路的人能给我看看为什么会超时STL的#include#include#include#include#include#include#incl...
分类:
其他好文 时间:
2014-05-06 00:30:42
阅读次数:
270
C++开发的项目难免会用到STL的string,使用管理都比char数组(指针)方便的多,但在得心应手的使用过程中也要警惕几个小陷阱,避免我们项目出bug却迟迟找不到原因。1.
结构体中的string赋值问题直接通过一个例子说明,下面的例子会输出什么:#include #include #i...
分类:
编程语言 时间:
2014-05-05 23:33:45
阅读次数:
413
Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given [100, 4,
200, 1, 3, 2],The longest...
分类:
其他好文 时间:
2014-05-05 23:01:41
阅读次数:
374
STL的组成标准模板库STL关注的重点是泛型数据结构和算法,其关键组成部分是容器(containers)、算法(algorithms)、迭代器(iterators)、函数对象(Function
Object)、适配(Adaptor)。本文地址:http://www.cnblogs.com/archi...
分类:
其他好文 时间:
2014-05-05 23:00:10
阅读次数:
360
指针与数组指针与其它数据结构呢?比如说链表?存储空间是非连续的。不能通过对指向这种数据结构的指针做累加来遍历。能不能提供一个行为类似指针的类,来对非数组的数据结构进行遍历呢?这样我们就能够以同样的方式来遍历所有数据结构(容器)。迭代器(Iterator)是指针(pointer)的泛化,它允许程序员以...
分类:
其他好文 时间:
2014-05-05 22:54:24
阅读次数:
596
本次内容:DateFormat类1、DateFormat类 1 package array; 2
/** 3 * 时间和字符串之间的转化 4 */ 5 import java.text.DateFormat; 6 import
java.text.ParseException; 7 impor...
分类:
编程语言 时间:
2014-05-02 14:16:19
阅读次数:
518