C program to perform stack operation using singly linked list
Answer Posted / bin fang
And much better and simpler implementation should be like
this:
void Push(int info)
{
node *temp;
temp = (node *)malloc(sizeof(node));
temp->data = info;
temp->next = head;
head = temp;
count++;
}
void Pop(void)
{
node *temp;
temp = head;
head = head->next;
free(temp);
count--;
}
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Is a pointer a kind of array?
When do we get logical errors?
Explain the use of bit fieild.
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What are the different properties of variable number of arguments?
Should I learn data structures in c or python?
What are void pointers in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is #pragma statements?
Explain continue keyword in c
Which one would you prefer - a macro or a function?
What is the most efficient way to store flag values?
What are control structures? What are the different types?
Why functions are used in c?