class Solution { public: vector
spiralOrder(vector > &matrix) { vector ret; int cols = 0; ...
分类:
其他好文 时间:
2014-05-28 14:38:02
阅读次数:
236
上一篇文章《STL系列》之vector原理及实现,介绍了vector的原理及实现,这篇文章介绍map的原理及实现。STL实现源码下载。STL中map的实现是基于RBTree的,我在实现的时候没有采用RBTree,觉得这东西有点复杂,我的map采用的是排序数组(CSortVector)。map中的Ke...
分类:
其他好文 时间:
2014-05-27 16:53:47
阅读次数:
338
const在函数中也有很大的作用。
4.const修饰传入参数。
函数传入参数声明为const,以指明使用这种参数仅仅是为了效率的原因,而不是想让调用函数能够修改该传入参数的值。同理,将对象指针参数或引用参数声明为const,函数将不修改由这个参数所指的对象。
例如:
#include
using namespace std;
//void change(const i...
分类:
编程语言 时间:
2014-05-26 05:52:27
阅读次数:
266
题目一:
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Fin...
分类:
其他好文 时间:
2014-05-26 04:06:41
阅读次数:
248
Several ports(8080,8009)required by Tomcat v6.0 Server at localhost are already in use.The server may already be running in another process, or a system process may be using the port, To start this server you will need to stop the other process or change t...
分类:
编程语言 时间:
2014-05-26 03:41:22
阅读次数:
364
issue:IhaveslowinternetconnectionandIcannotinstallanyplugin,becauseEclipse‘sUpdatemanagerthrowsmeexception:ava.net.SocketTimeoutException:Readtimedoutatjava.net.SocketInputStream.socketRead0(NativeMethod)atjava.net.SocketInputStream.read(UnknownSource)atja..
分类:
系统相关 时间:
2014-05-25 04:55:20
阅读次数:
406
权限管理
1,默认的三个用户
2,创建用户
3,授权,撤销权限
4,系统权限与对象权限
5,角色
6,通过角色对权限进行管理
7,权限的传递,丢失管理员密码怎么办
3个默认的用户
用户名 密码
sys change_on_install
system manager
scott ...
分类:
数据库 时间:
2014-05-25 01:57:04
阅读次数:
368
缓存(caching): 当组合结构很复杂,或者遍历的代价太高,那么实现组合节点的缓存就很有帮助。
(1) Java Collection Framework 指的是一群类的接口。 其中包括了 ArrayList, Vector , LinkedList , Stack ,和 PriorityQueue. 这些类都实现了java.util.Collection接口。
(2) Collect...
分类:
其他好文 时间:
2014-05-24 23:37:45
阅读次数:
432
题目:这个题目里要求最多交易2次。也就是说可以只交易一次,不交易也可以。
分析:将整个交易序列分割成两部分,求出这样的一种分割,使得两部分连续子序列的和相加的结果最大,当然,如果不进行分割,就是求出整个序列的最大连续子序列的和。
那么分割点就可能是任意位置。找出取得最大值的分割点,返回最大值。
int maxProfit(vector &prices) {
const int le...
分类:
其他好文 时间:
2014-05-24 20:54:57
阅读次数:
402
第6章 使用库算法
本章中主要教我们如何使用几个库算法来解决与处理字符串和学生成绩相关的问题。
1、分析字符串
使用一个循环来连接两幅字符图案
for(vector::const_iterator it = bottom.begin(); it != bottom.end(); ++it)
ret.push_back(*it);
等价于
ret.insert(ret.end(...
分类:
编程语言 时间:
2014-05-24 20:24:10
阅读次数:
365