how to implement stack operation using singly linked list

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using #define to declare a constant?

614


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1648


Why do we need a structure?

597


What is the difference between exit() and _exit() function in c?

590


How can I find the modification date of a file?

708






I have a varargs function which accepts a float parameter?

586


What is the use of c language in real life?

537


Why doesnt the call scanf work?

679


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1580


How can I implement a delay, or time a users response, with sub-second resolution?

631


What is the difference between class and object in c?

588


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

843


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

752


What is wrong in this statement?

613


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

2248