Last active
October 11, 2019 03:34
-
-
Save easleyschool/6a1dd229624f280b88ab7d646508dc8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class node | |
{ | |
int data; | |
node *next; | |
}; | |
class Stack | |
{ | |
private: | |
node *front; // points to the head of list | |
public: | |
// initialization | |
Stack() | |
{ | |
front = NULL; | |
} | |
// push method to add data element | |
void push(int); | |
// pop method to remove data element | |
void pop(); | |
// top method to return top data element | |
int top(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment