What is the difference between a stack and a linked list ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between a stack and a linked list ?

c

6th Apr 2017, 2:46 AM
Mohamed elqandili
Mohamed elqandili - avatar
3 Answers
+ 3
a stack is a type of linked list
6th Apr 2017, 3:15 AM
chris
chris - avatar
+ 2
when you push a value to the stack it is push to the top of the stack just like a stack of dishes stack on top of each other. when you want to pop it from the stack it will pop the first thing that was push to the stack
6th Apr 2017, 3:12 AM
chris
chris - avatar
+ 1
A stack is a structure to store a number of items where the last element added is the first element that can be removed. -A linked list is one of the possible way to implement a stack. But a linked list can also be used for other things such as Queues implementations. - And stack can also be implemented using arrays instead of linked lists.
14th May 2017, 6:49 AM
ifl
ifl - avatar