Adding 3rd assignment, stacks and queues
This commit is contained in:
23
Stacks&Queues/TStack.h
Normal file
23
Stacks&Queues/TStack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef STACKS_QUEUES_TSTACK_H
|
||||
#define STACKS_QUEUES_TSTACK_H
|
||||
|
||||
#define MAX_SIZE (100 * 100)
|
||||
|
||||
|
||||
class TStack {
|
||||
private:
|
||||
int stack[MAX_SIZE]{};
|
||||
int top = 0;
|
||||
|
||||
public:
|
||||
TStack() = default;
|
||||
~TStack() = default;
|
||||
|
||||
void Push(int item);
|
||||
[[nodiscard]] int Pop();
|
||||
[[nodiscard]] int Peek() const;
|
||||
[[nodiscard]] bool IsEmpty() const;
|
||||
|
||||
};
|
||||
|
||||
#endif //STACKS_QUEUES_TSTACK_H
|
||||
Reference in New Issue
Block a user