how to implement stack operation using singly linked list

Answers were Sorted based on User's Feedback



how to implement stack operation using singly linked list..

Answer / vignesh1988i

we know that stack is a data structure where the
highest priority will be given to the last element that is
pushed inside and the priority will decrease respectively to
the next consecutive elements........ so we are going to
implement in singly list .... so we are going to insert the
node to the left side of a reference node....... operations
performed in stack are : PUSH & POP..... PUSH here means we
are going to insert a element only at last ..... and POP
means displaying the node from first........


thank u

Is This Answer Correct ?    9 Yes 1 No

how to implement stack operation using singly linked list..

Answer / spandana

it is a datastructure which follows the principal of Last
in First order(LIFO) ie last inserted element will be
deleted first.hence both insertions and deletions takes
place at the same end.it can perform 2
operations "PUSH","POP". the special variable used in
stacks is "top"
stacks can be implemented using arrays,linked lists

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

what is the stackpointer

2 Answers  


what does the following function print? func(int i) { if(i%2)return 0; eale return 1; } main() { int =3; i=func(i); i=func(i); printf("%d",i);}

9 Answers   TCS,


Why is struct padding needed?

0 Answers  


Between macros and functions,which is better to use and why?

0 Answers  


Is reference used in C?

1 Answers  






Where does the name "C" come from, anyway?

0 Answers   Celstream,


what is the difference between arrays and linked list

26 Answers   MAHINDRA, Tech Mahindra, Wipro,


How are pointers declared in c?

0 Answers  


difference between the array and linked list general difference related to memory

2 Answers  


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 5 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

1 Answers  


main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }

2 Answers  


write a program to find the number of even integers and odd integers in a given array in c language

13 Answers   IAI Cameroun, NIIT, Olive Tech, QIS,


Categories