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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mystack.h

?? C++編成數(shù)據(jù)結(jié)構(gòu)與程序設(shè)計(jì)方法 D.S.Malk編著
?? H
字號(hào):
//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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品福利av| 欧美日韩在线电影| 日本一区二区三区四区| 韩国三级电影一区二区| 精品福利一区二区三区免费视频| 亚洲综合一二三区| 在线91免费看| 韩国av一区二区三区四区| 国产女人18水真多18精品一级做| 成人sese在线| 亚洲国产精品久久艾草纯爱 | 成人欧美一区二区三区小说 | 国产欧美日韩另类视频免费观看| 不卡的av中国片| 亚洲aⅴ怡春院| 久久视频一区二区| av成人老司机| 蜜桃久久av一区| 中文字幕第一区综合| 欧美撒尿777hd撒尿| 极品少妇一区二区三区精品视频| 国产精品久久久久毛片软件| 欧美亚洲另类激情小说| 精品亚洲免费视频| 亚洲乱码国产乱码精品精小说 | 欧美一区二区二区| 国产精品18久久久| 亚洲国产一区二区视频| 久久综合久久综合亚洲| 91原创在线视频| 久久国产精品免费| 亚洲人成网站影音先锋播放| 日韩欧美国产精品一区| 91老师国产黑色丝袜在线| 免费av成人在线| 亚洲美女偷拍久久| 国产亚洲一区二区在线观看| 欧美日韩第一区日日骚| 成人黄色免费短视频| 日韩精品电影在线观看| 亚洲视频综合在线| 久久久亚洲国产美女国产盗摄| 欧美日韩国产大片| 色婷婷久久久久swag精品| 精品一区二区三区久久| 丝袜国产日韩另类美女| 亚洲免费观看高清完整| 国产日韩欧美精品一区| 日韩欧美一级在线播放| 欧美视频在线观看一区| 91影视在线播放| 国产精品夜夜嗨| 极品尤物av久久免费看| 免费日本视频一区| 亚洲成人黄色小说| 亚洲尤物在线视频观看| 亚洲人成电影网站色mp4| 日本一区二区成人在线| 精品国产一区二区亚洲人成毛片| 欧美日本韩国一区二区三区视频| 97久久精品人人做人人爽| 美女视频网站久久| 肉色丝袜一区二区| 五月天精品一区二区三区| 亚洲欧美日本韩国| 亚洲婷婷综合久久一本伊一区| 日本一区二区三区四区| 国产欧美日韩不卡| 久久久久97国产精华液好用吗| 国产精品久久久久久久第一福利| 欧美成人欧美edvon| 日韩一区二区三区高清免费看看| 欧美日韩不卡一区二区| 欧美精品精品一区| 精品视频一区二区不卡| 欧美日韩成人综合天天影院 | 玉足女爽爽91| 亚洲精品中文在线观看| 亚洲精品国产无套在线观| 亚洲三级电影网站| 亚洲免费在线观看| 一区二区高清视频在线观看| 一区二区三区在线观看网站| 亚洲精品福利视频网站| 亚洲一区二区三区四区不卡| 亚洲一区二区在线播放相泽| 亚洲国产日韩一级| 日韩中文字幕亚洲一区二区va在线 | 欧美情侣在线播放| 欧美丰满少妇xxxbbb| 91精品国产一区二区三区蜜臀| 欧美一区二区人人喊爽| 日韩欧美一区中文| 国产日韩欧美激情| 亚洲男女一区二区三区| 亚洲国产综合视频在线观看| 日本成人在线不卡视频| 国模少妇一区二区三区| 成人动漫一区二区在线| 在线精品国精品国产尤物884a| 欧美久久久久中文字幕| 欧美哺乳videos| 国产精品―色哟哟| 亚洲一区自拍偷拍| 精品一区二区三区在线播放视频 | 亚洲成人三级小说| 久久99精品网久久| 99久久99久久免费精品蜜臀| 欧美性生活久久| 久久免费午夜影院| 亚洲综合丝袜美腿| 精东粉嫩av免费一区二区三区| 成人97人人超碰人人99| 欧美电影在线免费观看| 国产精品系列在线| 丝袜诱惑亚洲看片| gogo大胆日本视频一区| 欧美日本国产视频| 国产精品水嫩水嫩| 日本一不卡视频| 91在线国产福利| 日韩欧美一级精品久久| 黄色日韩三级电影| 在线视频中文字幕一区二区| 精品乱人伦小说| 亚洲成av人片一区二区三区| 国产精品一区二区你懂的| 欧美日韩一区二区在线观看视频| 国产色产综合产在线视频| 污片在线观看一区二区| 国产精品一二三四区| 91精品在线麻豆| 国产精品福利av| 国产综合一区二区| 欧美男男青年gay1069videost| 欧美国产激情二区三区| 日本午夜一区二区| 欧美三区在线视频| 亚洲欧美中日韩| 国产高清视频一区| 日韩欧美电影在线| 亚洲18影院在线观看| 97se亚洲国产综合自在线| 久久精品视频免费| 人人爽香蕉精品| 欧美日韩国产成人在线91| 亚洲欧美色一区| 成人av网站在线| 国产三级一区二区三区| 精品影院一区二区久久久| 日韩一区二区三区三四区视频在线观看| 亚洲免费观看高清完整版在线观看| 国产成人h网站| 久久久高清一区二区三区| 麻豆精品国产传媒mv男同| 51精品国自产在线| 天堂成人免费av电影一区| 欧美在线你懂得| 亚洲一二三四区| 欧美在线观看18| 亚洲一区在线看| 欧美唯美清纯偷拍| 亚洲电影一级片| 91麻豆精品国产无毒不卡在线观看| 亚洲国产成人高清精品| 欧美色图激情小说| 午夜欧美电影在线观看| 欧美肥大bbwbbw高潮| 全国精品久久少妇| 欧美xxxx在线观看| 国产麻豆精品在线| 国产三级三级三级精品8ⅰ区| 高清免费成人av| 一区在线观看免费| 色婷婷精品久久二区二区蜜臀av| 亚洲精品国产精华液| 在线看国产日韩| 蜜臀av性久久久久蜜臀av麻豆| 精品国产一区二区三区久久久蜜月| 国产毛片一区二区| 国产精品久久久99| 在线观看www91| 美女尤物国产一区| 久久精品欧美日韩| 99视频超级精品| 亚洲另类色综合网站| 8x8x8国产精品| 国产一区二区三区精品欧美日韩一区二区三区| 精品久久久久久久一区二区蜜臀| 国产精品亚洲综合一区在线观看| 国产精品久久三| 欧美日韩一本到| 久久99精品久久久久久国产越南| 国产三级一区二区| 欧美中文字幕一区| 久久精品99国产精品日本| 蜜臀精品久久久久久蜜臀 | 亚洲欧洲日韩av| 欧美色电影在线| 国产电影精品久久禁18|