⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stksequence.cpp

📁 自己写的堆栈算法
💻 CPP
字号:
#include "StkSequence.h"


template <class Type> Stack<Type>::Stack(int s):top(-1),MaxSize(s){
	elements = new Type[MaxSize];
	assert(elements != 0);
}

template <class Type> void Stack<Type>::Push(const Type &item){
	assert(!IsFull());
	elements[++top] = item;
}

template <class Type> Type Stack<Type>::Pop(){
	assert(!IsEmpty());
	return elements[top--];
}

template <class Type> Type Stack<Type>::GetTop(){
	assert(!IsEmpty());
	return elements[top];
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -