Created
October 11, 2019 03:19
-
-
Save easleyschool/3080463f2cd95958e69fca2699a3b0e1 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
void Stack::push(int d) | |
{ | |
// creating a new node | |
node *temp; | |
temp = new node(); | |
// setting data to it | |
temp->data = d; | |
// add the node in front of list | |
if(front == NULL) | |
{ | |
temp->next = NULL; | |
} | |
else | |
{ | |
temp->next = front; | |
} | |
front = temp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment