hash_map和map的用法很相似,只是底层机制有所不同。
hash_map容器采用的底层机制是hash table代码:
template ,
class EqualKey = equal_to,
class Alloc = alloc>
class hash_map
{
private:
typedef hashtable, Key...
分类:
其他好文 时间:
2014-05-13 22:59:23
阅读次数:
256
链接: http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1963
Description:
SunShine喜欢写日记,她把她的日记用TXT文件都保存在电脑里。每月一号和十六号,她都会新建一个TXT文件,然后接下来半个月,她都会在这个日记本里写。(为了方便,我们假设每个月都是30天)。今天是元旦,...
分类:
其他好文 时间:
2014-05-13 09:26:03
阅读次数:
352
Given an array, for example, 246135, an inversion pair is the pair whose first value is larger than its second value according to the sequence from left to right, (2,1) (4,1) (4,3) (6,1) (6,3) (6,5)....
分类:
其他好文 时间:
2014-05-13 08:03:58
阅读次数:
338
Pat1016代码
题目描述:
A long-distance telephone company charges its customers by the following rules:
Making a long-distance call costs a certain amount per minute, depending on the time of day w...
分类:
其他好文 时间:
2014-05-13 06:45:05
阅读次数:
460
容器hash_set是以hash table为底层机制的,几乎所有的操作都是转调用hash table提供的接口。由于插入无法存储相同的键值,所以hash_set的插入操作全部都使用hash table的insert_unique接口,代码如下:
pair insert(const value_type& obj)
{
pair p = rep.insert_unique(obj);
...
分类:
其他好文 时间:
2014-05-13 06:33:44
阅读次数:
303
HTTP请求中,如果是get请求,那么表单参数以name=value&name1=value1的形式附到url的后面,如果是post请求,那么表单参数是在请求体中,也是以name=value&name1=value1的形式在请求体中。通过chrome的开发者工具可以看到如下(这里是可读的形式,不是真正的HTTP请求协议的请求格式):
get请求:
RequestURL:http://127....
分类:
其他好文 时间:
2014-05-13 05:59:56
阅读次数:
353
本段程序主要利用数据结构栈的先进后出特点,实现回溯求解迷宫路径问题。
#include
#include
using namespace std;
//坐标类
struct Point
{
int x;
int y;
};
//地图类
template
struct Map
{
int (*p)[A];
int row;//行数
int col;//列数
};
//start起始点, ...
分类:
其他好文 时间:
2014-05-13 05:25:02
阅读次数:
478
一、简介MSM(memcached-session-manager)支持tomcat6和tomcat7,利用Value(Tomcat阀对Request进行跟踪。Request请求到来时,从memcached加载session,Request请求结束时,将tomcatsession更新至memcached,以达到session共享之目的,支持sticky和non-sticky模式。Sticky模式:..
分类:
其他好文 时间:
2014-05-13 05:04:23
阅读次数:
517
publicstaticStringcreateJsonString(Stringkey,Objectvalue){
JSONObjectjsonObject=newJSONObject();
jsonObject.put(key,value);
returnjsonObject.toString();
}
分类:
Web程序 时间:
2014-05-13 04:28:35
阅读次数:
316
keyboard.S 部分代码分析(key_map)
keyboard中间有这么一段,我一开始没看明白,究竟啥意思
key_map:
.byte 0,27
.ascii "1234567890-="
.byte 127,9
.ascii "qwertyuiop[]"
.byte 13,0
.ascii "asdfghjkl;'"
.byte '`,0
.ascii ...
分类:
系统相关 时间:
2014-05-12 22:41:23
阅读次数:
701