码迷,mamicode.com
首页 >  
搜索关键字:capacity    ( 831个结果
数据结构:模板实现栈和队列
(一)模板实现栈#pragmaonce typedefunsignedintsize_t; template<classT> classStack { public: Stack() :_array(NULL) ,_top(-1) ,_capacity(0) {} ~Stack() { if(_array) { delete[]_array; } } public: voidPush(constT&num) { _CheckCapacity(); _array[++_top..
分类:其他好文   时间:2016-04-10 19:45:48    阅读次数:159
用2个栈实现队列
template<classT,intDEFAULT_CAPACITY=0> classStack { public: Stack(); Stack(constStack<T>&st); Stack&operator=(constStack<T>&st); ~Stack(); public: voidPush(constT&data); voidPop(); T&Top(); T&End(); boolEmp..
分类:其他好文   时间:2016-04-09 17:07:15    阅读次数:102
ElasticSearch报 EsThreadPoolExecutor[search, queue capacity = 1000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@c0efba
ElasticSearch报以下错误的解决办法: "type": "es_rejected_execution_exception", "reason": "rejected execution of org.elasticsearch.transport.TransportService$4@1f ...
分类:其他好文   时间:2016-04-08 19:48:23    阅读次数:1278
安卓视频处理总结
04-04 16:55:57.099 28015-28195/com.rockylearnstorock.testcamera D/MediaHelper: {csd-1=java.nio.ByteArrayBuffer[position=0,limit=8,capacity=8], mime=vi ...
分类:移动开发   时间:2016-04-05 09:27:16    阅读次数:659
lintcode-medium-Rehashing
The size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size >= capacity / 10), we should do ...
分类:其他好文   时间:2016-04-04 17:47:32    阅读次数:175
数据结构---哈希表(KV模式)(除留余数法)
可以实现快速定位查找数据思想一:开一个适当大小的数组,讲需要存入的数据%上数组的_capacity的到的数作为他存放的位置,如果这个位置被占了,则在他的下一个位置存放数据(不会找不到空位置,下面会说到)。思想二:存放在数组上的是一个结构体,结构体包含一个索引值Key,存..
分类:其他好文   时间:2016-04-04 07:00:21    阅读次数:241
动态顺序表
seqlist.h #pragma once #define _SEQ_LIST_ #ifdef _SEQ_LIST_ #include<stdio.h> #include<assert.h> #include<string.h> #define DEFAULT_CAPACITY 3 typedef ...
分类:其他好文   时间:2016-04-02 17:26:30    阅读次数:264
实现一个栈,Push,Pop,Min,并且保证时间复杂度为O(1)
#include<iostream> usingnamespacestd; structstack { int*_pElem;//指向元素数据的指针 int_capacity; int_top; stack(intn) :_capacity(n) { _top=0; _pElem=newint[_capacity]; } ~stack() { delete[]_pElem; _pElem=NULL; } }; classStack { private: stacks; s..
分类:其他好文   时间:2016-04-01 06:42:13    阅读次数:145
顺序表和链表的模板
c++引入模板是为了更好的代码复用,模板这边分为两个大块.1.模板函数2.模板类我们今天来介绍模板类的应用—顺序表和链表(单链表为例)//模板的顺序表 template<classT> classSeqList { public: SeqList() :_array(NULL) ,_size(0) ,_capacity(0) {} ~SeqList..
分类:其他好文   时间:2016-03-31 15:03:29    阅读次数:185
c++ 模板实现顺序表
/************************************ WZASUST2016 顺序表第二个模板 ************************************/ #include"wz.h" #include"sts.h" template<typenameT> classseqlist { public: seqlist() :_data(NULL) ,_size(0) ,_capacity(0) { CheckCapacity(); } /*..
分类:编程语言   时间:2016-03-31 07:12:11    阅读次数:349
831条   上一页 1 ... 56 57 58 59 60 ... 84 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!