Files
Data-Structure/Stack/chainStack/main.cpp
2025-07-21 17:08:57 +08:00

42 lines
632 B
C++

#include <iostream>
#include "node.h"
#include "stack.h"
#include "chainStack.h"
using namespace std;
/*
TO TEST:
private:
Node<T>* first;
Node<T>* last;
int stackTop;
public:
chainStack() = delete;
chainStack(Node<T>* f = nullptr);
chainStack(const chainStack<T>& x);
virtual bool empty() const;
virtual int size() const;
virtual T& top();
virtual void pop();
virtual void push(const T& theElement);
virtual void show() const;
~chainStack()
*/
int main() {
chainStack<char> s(nullptr);
s.push('a');
s.show();
s.push('b');
s.show();
s.push('z');
s.show();
s.pop();
s.show();
return 0;
}
/*
a
a b
a b z
a b
*/