Skip to content

Instantly share code, notes, and snippets.

@easleyschool
Last active October 11, 2019 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easleyschool/6a1dd229624f280b88ab7d646508dc8b to your computer and use it in GitHub Desktop.
Save easleyschool/6a1dd229624f280b88ab7d646508dc8b to your computer and use it in GitHub Desktop.
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