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

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

?? mystack.h

?? C++編成數據結構與程序設計方法 D.S.Malk編著
?? H
字號:
//Header file: myStack.h

#ifndef H_StackType
#define H_StackType

#include <iostream>
#include <cassert>

#include "stackADT.h"

using namespace std;

template <class Type>
class stackType: public stackADT<Type>
{
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 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>
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
}//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];		   			   

        //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一区二区三区免费野_久草精品视频
日韩欧美自拍偷拍| 久久久九九九九| 国产高清久久久久| 亚洲国产裸拍裸体视频在线观看乱了 | 国产成人精品免费看| 亚洲成av人影院在线观看网| 中文在线一区二区| 欧美日本在线播放| 91在线丨porny丨国产| 国产乱子伦一区二区三区国色天香| 亚洲欧美日韩小说| 国产清纯美女被跳蛋高潮一区二区久久w| 91精品1区2区| av高清不卡在线| 国产精品一区二区免费不卡 | 成人免费视频视频在线观看免费| 亚洲chinese男男1069| 亚洲免费在线播放| 成人欧美一区二区三区黑人麻豆 | 91免费观看视频在线| 国产一区二区三区免费观看| 日产国产欧美视频一区精品| 亚洲一区在线视频观看| 亚洲色图一区二区三区| 国产精品久久久久久久久免费樱桃| 亚洲精品一线二线三线无人区| 欧美猛男超大videosgay| 欧美影院精品一区| 在线观看一区日韩| 欧洲精品一区二区| 色拍拍在线精品视频8848| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲欧洲av另类| 色综合 综合色| 色综合视频在线观看| 91在线无精精品入口| 91蝌蚪国产九色| 在线日韩av片| 欧美日韩国产色站一区二区三区| 91国产丝袜在线播放| 色老汉av一区二区三区| 91黄色小视频| 欧美亚洲另类激情小说| 欧美婷婷六月丁香综合色| 欧美日韩国产另类一区| 91精品国产一区二区三区蜜臀 | 欧美日韩情趣电影| 欧美日韩国产综合一区二区 | 日本道精品一区二区三区| 91美女蜜桃在线| 欧美亚洲动漫制服丝袜| 欧美乱妇15p| 精品福利二区三区| 国产婷婷精品av在线| 国产精品久久久久久久午夜片| 亚洲欧美偷拍另类a∨色屁股| 亚洲精品国产精华液| 三级在线观看一区二区| 美女视频黄 久久| 国内成+人亚洲+欧美+综合在线| 国产成人精品三级| 色88888久久久久久影院野外 | 国产精品午夜免费| 亚洲免费观看视频| 丝袜诱惑制服诱惑色一区在线观看 | 国产伦精品一区二区三区在线观看| 国产成人在线视频免费播放| 久久夜色精品国产噜噜av| 久久综合色一综合色88| 国产精品色呦呦| 午夜伦理一区二区| 久久国产尿小便嘘嘘| 9i在线看片成人免费| 欧美日韩国产一级| 国产欧美精品一区二区色综合朱莉| 国产精品久久久久久久岛一牛影视| 一区二区三区日本| 久久99精品久久只有精品| 不卡一区中文字幕| 日韩欧美国产三级| 中文字幕一区二区三中文字幕| 午夜精品视频在线观看| 成人性生交大片免费看中文网站 | 精品国产成人在线影院| 亚洲色大成网站www久久九九| 麻豆精品视频在线观看视频| jlzzjlzz亚洲日本少妇| 欧美v国产在线一区二区三区| 亚洲婷婷国产精品电影人久久| 麻豆精品久久久| 欧美在线你懂的| 中文字幕av一区二区三区免费看| 日韩制服丝袜av| 91欧美激情一区二区三区成人| 欧美v亚洲v综合ⅴ国产v| 一区二区三区精品在线观看| 韩国精品在线观看| 欧美人与性动xxxx| 亚洲人成精品久久久久久| 久久99精品久久久久久动态图| 91精品福利视频| 国产精品另类一区| 久久99精品国产.久久久久久| 一本久道中文字幕精品亚洲嫩| 精品国内片67194| 五月婷婷另类国产| 在线不卡一区二区| 欧美日韩综合不卡| 亚洲人成网站在线| 国产精品乡下勾搭老头1| 日韩一区二区视频| 午夜精品一区二区三区电影天堂| 99国产欧美另类久久久精品 | 亚洲精品高清视频在线观看| 国产大陆精品国产| 久久综合九色欧美综合狠狠 | 亚洲国产成人高清精品| 91丨九色丨尤物| 国产精品福利一区| 成人免费毛片aaaaa**| 久久久久久久久久久久久女国产乱 | 欧美又粗又大又爽| 亚洲人成在线播放网站岛国| 处破女av一区二区| 欧美激情一区二区三区| 国产精品18久久久久久久网站| 日韩一区二区电影在线| 日本不卡123| 欧美一区二区三区在线视频| 亚洲一区二区黄色| 91激情五月电影| 亚洲一区二区三区自拍| 日本精品一区二区三区四区的功能| 亚洲色图.com| 91黄色激情网站| 亚洲在线中文字幕| 欧美性一区二区| 亚洲第一福利视频在线| 欧美日韩精品一区二区在线播放| 亚洲成av人片| 日韩欧美另类在线| 欧美午夜精品一区二区蜜桃| 欧美日韩电影在线| 轻轻草成人在线| 精品99999| 成人午夜激情影院| 亚洲欧美日韩中文字幕一区二区三区| 色综合久久综合网97色综合| 亚洲乱码中文字幕| 欧美男人的天堂一二区| 久久爱另类一区二区小说| 精品国产污网站| 波多野结衣精品在线| 亚洲综合色丁香婷婷六月图片| 欧美日韩dvd在线观看| 久久精品国产亚洲5555| 中文在线资源观看网站视频免费不卡| 一本高清dvd不卡在线观看| 亚洲成a人片综合在线| 日韩欧美国产精品| 成人美女视频在线看| 一区二区三区中文字幕电影| 欧美一区二区三区色| 国产一区二区在线影院| 亚洲欧美日韩在线播放| 日韩三级免费观看| 成人在线视频一区| 水蜜桃久久夜色精品一区的特点| 精品日韩99亚洲| 91农村精品一区二区在线| 五月天精品一区二区三区| 久久精品亚洲精品国产欧美kt∨| 色综合天天综合网国产成人综合天| 天堂av在线一区| 国产午夜精品理论片a级大结局 | 精品卡一卡二卡三卡四在线| 成人97人人超碰人人99| 午夜电影久久久| 欧美激情综合在线| 91精品国产高清一区二区三区 | 成人毛片在线观看| 国产成人在线免费观看| 欧美日韩在线亚洲一区蜜芽| 激情综合网av| 亚洲激情在线播放| 久久综合九色综合97婷婷| 91国偷自产一区二区三区观看 | 久久成人av少妇免费| 《视频一区视频二区| 欧美成人伊人久久综合网| 日本道在线观看一区二区| 国产美女一区二区| 日韩精品电影在线观看| 中文字幕综合网| 久久久久综合网| 欧美一级淫片007| 欧美性色黄大片| av在线播放成人| 国产精品123区| 喷水一区二区三区|