top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between LinkList and Stack?

0 votes
410 views

Sorry for simple query?

posted Aug 14, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Stack and link list are both are data structures.

1) Stack is a liner type data structure, i.e. they are arranging in liner manner. In stack whatever is stored first it comes out last. It works in LIFO manner(Last in first out). In stack you can’t add element in between. They are like a stack of coins, i.e. if you want to take the last coin, then all the upper coins have to be removed one by one.
2) Link list is not a liner data structure. Here you can access any element or add any element in between. There is no LIFO of LILO manner (last in last out). In Link list you basically use to pointers , one to store the value of the variable and other to store the address of the next node(link list single element known as node).As the next link list address is store in the second node, there is no restriction in adding a new link list element in between . Use:
3) Linked lists provide very fast insertion or deletion of a list member. As each linked list contains a pointer to the next member in the list. Whereas there is disadvantage if you want to perform random accesses it has to go through all the lists.

answer Aug 16, 2014 by anonymous
0 votes

Link list a data structure whose all nodes are connected in linear fashion. Each node in the Link List has two information 1. content of the node and 2. pointers to next/prev nodes.

Whereas stack is a Abdstract Data Structure which two operations push and pop which has LIFO (Last In first Out) mechanism of accessing a node in the ADT.

May be a Implementation if these is a matter of the article...

answer Aug 17, 2014 by Salil Agrawal
Similar Questions
+3 votes

How to find if a node/pointer corrupted in a linked list any suggestion?

...