亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mystack.h

?? 上載的是c++源代碼
?? H
字號:
//Header file: myStack.h

#ifndef H_StackType
#define H_StackType

#include <iostream>
#include <cassert>

using namespace std;

template<class Type>
class stackType
{
public:
    const stackType<Type>& operator=(const stackType<Type>&); 
      //Overload the assignment operator.
    void initializeStack();
      //Function to initialize the stack to an empty state.
      //Postcondition: stackTop = 0
    bool isEmptyStack() const;
      //Function to determine whether the stack is empty.
      //Postcondition: Returns true if the stack is empty,
      //               otherwise returns false.
    bool isFullStack() const;
      //Function to determine whether the stack is full.
      //Postcondition: Returns true if the stack is full,
      //               otherwise returns false.
    void destroyStack();
      //Function to remove all the elements from the stack.
      //Postcondition: stackTop = 0

    void push(const Type& newItem);
      //Function to add newItem to the stack.
      //Precondition: The stack exists and is not full.
      //Postcondition: The stack is changed and newItem 
      //               is added to the top of the stack.
    Type top() const;
      //Function to return the top element of the stack.
      //Precondition: The stack exists and is not empty.
      //Postcondition: If the stack is empty, the program 
      //               terminates; otherwise, the top element
      //               of the stack is returned.
    void pop();
      //Function to remove the top element of the stack.
      //Precondition: The stack exists and is not empty.
      //Postcondition: The stack is changed and the top 
      //               element is removed from the stack.

    stackType(int stackSize = 100); 
      //constructor
      //Create an array of the size stackSize to hold 
      //the stack elements. The default stack size is 100.
      //Postcondition: The variable list contains the base
      //               address of the array, stackTop = 0, and  
      //               maxStackSize = stackSize.
    stackType(const stackType<Type>& otherStack); 
      //copy constructor
    ~stackType(); 
      //destructor
      //Remove all the elements from the stack.
      //Postcondition: The array (list) holding the stack 
      //               elements is deleted.

private:
    int maxStackSize; //variable to store the maximum stack size
    int stackTop;     //variable to point to the top of the stack
    Type *list;       //pointer to the array that holds the
                      //stack elements

    void copyStack(const stackType<Type>& otherStack); 
      //Function to make a copy of otherStack.
      //Postcondition: A copy of otherStack is created and
      //               assigned to this stack.
};


template<class Type>
void stackType<Type>::initializeStack()
{
	stackTop = 0;
}//end initializeStack

template<class Type>
void stackType<Type>::destroyStack()
{
	stackTop = 0;
}//end destroyStack

template<class Type>
bool stackType<Type>::isEmptyStack() const
{
	return(stackTop == 0);
}//end isEmptyStack

template<class Type>
bool stackType<Type>::isFullStack() const
{
	return(stackTop == maxStackSize);
} //end isFullStack

template<class Type>
void stackType<Type>::push(const Type& newItem)
{
    if (!isFullStack())
    {
		list[stackTop] = newItem;    //add newItem to the 
 					//top of the stack
		stackTop++;   //increment stackTop
    }
    else
		cout << "Cannot add to a full stack." << endl;
}//end push

template<class Type>
Type stackType<Type>::top() const
{
	assert(stackTop != 0);              //if stack is empty, 
 										//terminate the program
	return list[stackTop - 1];			//return the element of the 
										//stack indicated by 
 					  					//stackTop - 1
}//end top

template<class Type>
void stackType<Type>::pop()
{
	if (!isEmptyStack())
	    stackTop--;             //decrement stackTop 
 	else
	   cout << "Cannot remove from an empty stack." << endl;
}//end pop

template<class Type>
stackType<Type>::stackType(int stackSize) 
{
	if(stackSize <= 0)
	{
		cout << "Size of the array to hold the stack must "
			 << "be positive." << endl;
		cout << "Creating an array of size 100." << endl;

		maxStackSize = 100;
	}
	else
		maxStackSize = stackSize;  //set the stack size to 
   				     	   //the value specified by 
 				     	   //the parameter stackSize

	stackTop = 0;				   //set stackTop to 0
	list = new Type[maxStackSize]; //create the array to
  									//hold the stack elements
	assert(list != NULL);
}//end constructor

template<class Type>
stackType<Type>::~stackType() //destructor
{
   delete [] list; //deallocate the memory occupied 
                   //by the array
}//end destructor

template<class Type>
void stackType<Type>::copyStack(const stackType<Type>& otherStack)
{ 

 	delete [] list;				   
	maxStackSize = otherStack.maxStackSize;		   
  	stackTop = otherStack.stackTop;			   
	  
    list = new Type[maxStackSize];		   
	assert(list != NULL);			   

             //copy otherStack into this stack
    for (int j = 0; j < stackTop; j++)  
        list[j] = otherStack.list[j];
} //end copyStack


template<class Type>
stackType<Type>::stackType(const stackType<Type>& otherStack)
{
	list = NULL;

	copyStack(otherStack);
}//end copy constructor

template<class Type>
const stackType<Type>& stackType<Type>::operator=
   					(const stackType<Type>& otherStack)
{ 
   if (this != &otherStack) //avoid self-copy
 	  copyStack(otherStack);

   return *this; 
} //end operator=         

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性猛交xxxx乱大交退制版| 精品一区二区三区av| 色狠狠色狠狠综合| 麻豆成人免费电影| 亚洲精品老司机| 精品国精品国产| 日本丰满少妇一区二区三区| 蜜桃视频免费观看一区| 中文字幕欧美激情一区| 91精品婷婷国产综合久久| 成人午夜免费电影| 精品一区二区免费看| 一区二区三国产精华液| 久久一区二区视频| 日韩片之四级片| 91精品国产综合久久久蜜臀粉嫩 | 亚洲视频在线观看一区| 久久精品夜色噜噜亚洲aⅴ| 欧美美女喷水视频| 91国产丝袜在线播放| 99re这里只有精品视频首页| 国产福利精品一区| 国产一区免费电影| 国产精品一区二区在线播放| 极品尤物av久久免费看| 寂寞少妇一区二区三区| 九一久久久久久| 国产九色sp调教91| 国产ts人妖一区二区| 99精品在线免费| 99re8在线精品视频免费播放| av资源网一区| 欧洲精品一区二区| 欧美另类久久久品| 精品成人一区二区三区四区| 国产午夜精品理论片a级大结局| 国产人成亚洲第一网站在线播放 | 国产91精品精华液一区二区三区| 国产九九视频一区二区三区| 福利电影一区二区| 91官网在线免费观看| 欧美一区二区精品在线| 日韩欧美黄色影院| 国产精品对白交换视频 | 欧美一区二区三区四区视频| 精品国产一区二区三区四区四| 2023国产精品| 亚洲妇女屁股眼交7| 国产精品自拍网站| 欧美在线观看视频一区二区| 欧美伦理电影网| 一区精品在线播放| 日韩国产高清影视| 一本久久a久久精品亚洲| 日韩欧美美女一区二区三区| 亚洲毛片av在线| 国产精品一区在线观看你懂的| 欧美天堂亚洲电影院在线播放| 在线视频欧美区| 久久综合九色综合97_久久久| 亚洲已满18点击进入久久| 国产一区二区看久久| 制服丝袜国产精品| 亚洲一区二区三区四区五区黄| 国产精品一区二区男女羞羞无遮挡 | 国产综合一区二区| 在线播放国产精品二区一二区四区| 中文字幕一区二区三区不卡在线 | 99re亚洲国产精品| 国产精品久久久久久久久久免费看| 九九九久久久精品| 4438x亚洲最大成人网| 亚洲一区二区三区四区在线免费观看| 国产精品一区二区在线观看网站| 欧美大片在线观看一区二区| 婷婷综合另类小说色区| 欧美人与z0zoxxxx视频| 三级不卡在线观看| 日韩视频免费直播| 狠狠色丁香婷综合久久| 日韩美一区二区三区| 另类小说综合欧美亚洲| www亚洲一区| 成人性生交大片免费看视频在线 | 717成人午夜免费福利电影| 夜夜精品视频一区二区| 欧美另类变人与禽xxxxx| 久久精品国产在热久久| 国产日韩欧美一区二区三区综合 | 不卡一二三区首页| 一区二区免费视频| 欧美电影免费观看高清完整版| 国产在线视频精品一区| 亚洲色图欧美在线| 制服视频三区第一页精品| 国产精品123| 久久久久国产精品麻豆ai换脸 | 秋霞电影网一区二区| 久久久亚洲精华液精华液精华液| 不卡视频免费播放| 日本成人超碰在线观看| 国产精品免费久久久久| 欧美日韩精品系列| 99久久久久久99| 麻豆中文一区二区| 亚洲男人天堂av网| 国产三区在线成人av| 6080午夜不卡| 91香蕉视频在线| 国产福利91精品一区| 日韩 欧美一区二区三区| 国产精品污www在线观看| 欧美一区二区二区| 欧美在线视频全部完| 成人黄色大片在线观看| 狠狠狠色丁香婷婷综合久久五月| 亚洲国产日产av| 亚洲欧美激情一区二区| 国产精品九色蝌蚪自拍| 日韩精品中午字幕| 日韩欧美久久久| 日韩欧美激情一区| 欧美不卡一区二区三区| 91精品国产综合久久久久| 日韩免费一区二区| 午夜影院在线观看欧美| 99久久99久久精品国产片果冻| 欧美一区二区三区婷婷月色| 国产成人鲁色资源国产91色综| 中文字幕精品一区二区三区精品| 2014亚洲片线观看视频免费| 精品粉嫩aⅴ一区二区三区四区| 91精品国产综合久久福利| 欧美福利视频一区| 欧美一区二区三区四区视频| 日韩欧美国产精品一区| 日韩欧美一级精品久久| 26uuu国产电影一区二区| 中文字幕不卡在线观看| 亚洲免费伊人电影| 日本色综合中文字幕| 国产成人免费在线视频| 99re在线视频这里只有精品| 欧美在线短视频| 精品国产123| 亚洲色图一区二区三区| 午夜精品久久久久久久久| 久久99精品国产.久久久久久| 国产福利一区二区三区| 欧美日韩一区高清| 国产性做久久久久久| 亚洲一区二区三区四区的 | 婷婷综合五月天| 成人97人人超碰人人99| 91精品综合久久久久久| 中文字幕一区二区5566日韩| 亚洲va国产va欧美va观看| 奇米色一区二区| 国产高清亚洲一区| 欧美丝袜丝交足nylons| 国产亚洲一区二区在线观看| 亚洲精品视频在线观看网站| 精品一区二区三区在线观看 | 欧美一区二区视频网站| 亚洲精品久久久久久国产精华液| 激情综合色丁香一区二区| 欧美性生活久久| 亚洲猫色日本管| 99久久免费精品高清特色大片| 亚洲精品一线二线三线| 日本不卡免费在线视频| 欧美日韩国产一级片| 亚洲欧美一区二区三区久本道91 | 性做久久久久久久久| 91蜜桃传媒精品久久久一区二区| 久久你懂得1024| 国产在线精品一区二区三区不卡| 欧美日韩www| 日韩中文字幕区一区有砖一区 | 日韩在线播放一区二区| 欧美日韩国产精品成人| 天堂va蜜桃一区二区三区 | 国内精品写真在线观看| 日韩视频在线永久播放| 蜜芽一区二区三区| 亚洲精品一区在线观看| 国产麻豆一精品一av一免费 | 欧美日韩亚洲综合一区| 亚洲二区在线观看| 欧美xxxxxxxx| 成人一区在线看| 亚洲三级久久久| 欧美日韩视频在线第一区 | 亚洲电影中文字幕在线观看| 欧美精品一二三四| 国产一区美女在线| 亚洲精品日韩综合观看成人91| 欧美精品一二三区| 国产东北露脸精品视频| 依依成人精品视频|