码迷,mamicode.com
首页 >  
搜索关键字:capacity    ( 831个结果
【技巧】通过适配器模式完成栈的数据结构
学习了模板,我们发现,c++中的众多数据结构,如栈与队列跟模板,只是方法上与线性表不同,其真正意义上的结构,也就是线性表,代码如下:template<typenameT> classSeqList { private: int_size; int_capacity; T*_data; }; //template<classT,template<class>..
分类:其他好文   时间:2016-03-18 17:57:24    阅读次数:151
mina IoBuffer 常用方法
Limit(int) 如果position>limit, position = limit,如果mark>limit, 重置mark Mark() 取当前的position的快照标记mark Reset() 恢复position到先前标记的mark Clear() limit=capacity ,
分类:其他好文   时间:2016-03-18 17:33:27    阅读次数:1447
C++ String类
头文件"String.h" #include<iostream> #include<assert.h> usingnamespacestd; classString { public: String(constchar*str="") { intlen=strlen(str); _capacity=len+1; _size=len; _str=newchar[_capacity]; strcpy(_str,str); } //交换函数 void_Swap(Stri..
分类:编程语言   时间:2016-03-17 12:58:21    阅读次数:220
c++实现顺序表
顺序表可看成一位数组。#include<iostream>usingnamespacestd;typedefintDataType;#defineMAX_CAPACITY3classSeqlist{ friendostream&operator<<(ostream&os,Seqlist&x);public: Seqlist(DataTypecapacity=MAX_CAPACITY)//构造顺序表 :_size(0) ,_pd..
分类:编程语言   时间:2016-03-17 07:18:19    阅读次数:249
利用C++类实现顺序表
以前写过用C语言实现的顺序表,现在来看看用C++类实现的吧classSeqList { public: SeqList(intcapacity=DEFAULT_CAPACITY) :_capacity(capacity) ,_size(0) ,_pData(0) { _pData=newDataType[_capacity]; } ~SeqList() { if(_pData!=NULL) { delete[]_pDa..
分类:编程语言   时间:2016-03-12 23:11:27    阅读次数:296
简单模拟STL库中string的实现
#include<iostream> #include<assert.h> #include<malloc.h> #defineCAPACITY3 usingnamespacestd; classString { public: String(char*str="") :_str((char*)malloc(strlen(str)+1)), _size(strlen(str)) { strcpy(_str,str); _capacity=_size+1;..
分类:其他好文   时间:2016-03-11 22:32:35    阅读次数:183
YARN调度
理想的世界,一个YARN应用请求将会立刻得到授予。而现实世界,资源是受限制的,在一个忙碌的集群中,一个应用经常需要等待他请求的资源。YARN调度负责这个事情,分配资源给应用通过一些方式定义。调度是一个困难的问题也没有所谓最好的方法。 YARN有三种调度,FIFO,Capacity,Fair Sche
分类:其他好文   时间:2016-03-04 16:06:42    阅读次数:124
顺序表(C++实现)
顺序表是基本的数据结构,创建Seqlist类,主要包括类的默认成员函数(构造函数、析构函数、赋值运算符重载),顺序表的基本功能实现。 //顺序表 typedefintDataType; classSeqlist { public: Seqlist()//无参构造函数 :_array(NULL) ,_size(0) ,_capacity(0) {} ~Seqlist()//..
分类:编程语言   时间:2016-02-29 23:23:27    阅读次数:315
flume 报File Channel transaction capacity cannot be greater than the capacity of the channel capacity错误
今天在部署flume集群时,在启动collector服务器没报错,启动agent服务器报错: File Channel transaction capacity cannot be greater than the capacity of the channel capacity 查了下相关解决办法
分类:Web程序   时间:2016-02-26 11:51:15    阅读次数:205
Item 52:写了placement new就要写placement delete
Item 52: Write placement delete if you write placement new “placement new”通常是专指指定了位置的new(std::size_t size, void *mem),用于vector申请capacity剩余的可用内存。 但广义的”placement new”指的是拥有额外参数的operator new。 ...
分类:其他好文   时间:2016-02-21 14:24:18    阅读次数:166
831条   上一页 1 ... 58 59 60 61 62 ... 84 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!