Skip to content

Commit a322024

Browse files
committed
change size function to getsize and add last function
1 parent b03dab8 commit a322024

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

LLStack.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,28 @@
77
#ifndef STACK_LLSTACK_H
88
#define STACK_LLSTACK_H
99

10+
#define nullptr 0
11+
12+
template <class type>
13+
class LLStackNode
14+
{
15+
public:
16+
type data;
17+
LLStackNode *last;
18+
};
1019

1120
template <class type> class LLStack {
1221
private:
22+
long size;
23+
LLStackNode <type>*head;
1324

1425
public:
1526
LLStack();
1627
void push(type data);
17-
type pop();
28+
type *pop(type &data);
29+
type last();
1830
bool isEmpty();
19-
long size();
31+
long getSize();
2032
};
2133

2234
#include "LLStack.cpp"

0 commit comments

Comments
 (0)