stackcopy.cpp

来自「包括图、二叉树、链表」· C++ 代码 · 共 49 行

CPP
49
字号
#include"stackcopy.h"
stackcopy::stackcopy()
{
	countcopy=0;
}
bool stackcopy::empty()
{
	bool outcome=true;
	if(countcopy==0)
		outcome=false;
	return outcome;
}

bool stackcopy::full()
{
	bool outcome=true;
	if(countcopy<stack_max)
		outcome=false;
	return outcome;
}
int stackcopy::size()
{
	return countcopy;
}
stack_entry stackcopy::top()
{
		if(countcopy==0)
			return 0;
		return entry[countcopy-1];
}
Eorro_codecopy stackcopy::push(stack_entry&item)
{

	Eorro_codecopy outcome=succese;
	if(countcopy==stack_max)
		outcome=overflow;
	else
		entry[countcopy++]=item;
	return outcome;
}
Eorro_codecopy stackcopy::pop()
{
	Eorro_codecopy outcome=succese;
	if(countcopy==0)
		outcome=underflow;
	else
		countcopy--;
	return outcome;
}

⌨️ 快捷键说明

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