91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 9KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-03
  • 語言: C/C++
  • 標簽: ??模板??

資源簡介

這個是用模板實現的棧,有利于學習模板,以及學習棧的知識。

資源截圖

代碼片段和文件信息

/*
????Discription:?To?implement?a?class?of?satck?with?many?operations
????Author:?Jiang?Liuyang
????Cridit:?2016202185
????Date:?2018/04/20
*/
#include?
#include?
#include?
#include?
#include?

using?namespace?std;

template??//?a?template?of?the?class?Stack
class?Stack?//?the?difination?of?the?class?Stack
{
private:
????T*?top;?//?a?pointer?point?to?the?first?position?of?the?array
????int?capacity;?//?the?maximal?number?the?stack?will?contain
????int?size;?//?the?number?of?stack?have?contained
public:
????Stack(int?tem_size)?//?initial?of?a?stack
????{
????????T*?p;
????????size?=?0;
????????capacity?=?tem_size;
????????//p?=?(int?*)malloc(sizeof(int)*capacity);
????????p?=?new?T?[capacity];
????????i

評論

共有 條評論