MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / push

Function push

12. Queue/Queueusing2Stacks.cpp:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void push(struct nod **top_ref, int n_d)
47{
48 struct nod *new_node = (struct nod *)malloc(sizeof(struct nod));
49
50 if (new_node == NULL)
51 {
52 cout << "Stack underflow \n";
53 exit(0);
54 }
55 //put items on stack
56 new_node->d = n_d;
57 new_node->n = (*top_ref);
58 (*top_ref) = new_node;
59}
60
61int pop(struct nod **top_ref)
62{

Callers 2

enQueueFunction · 0.70
deQueueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected