1,028 views
1 votes
1 votes
Implement Linked list using stack.

1 Answer

0 votes
0 votes
Stacks are Abstract Data types which can be created using Linked-List or arrays depending on our need. If we want to create a LinkedList using stack, we can do it like suppose we pop ,the  top element from the stack, create a node using malloc and then  insert it at the front of the list, maintaining a head of the linked list and it will be updated every time we pop one element  from the stack.

Related questions

0 votes
0 votes
2 answers
3
Arjun asked Oct 10, 2016
523 views
Consider the following declaration of a two dimensional array in C:char a[1000][40];Assuming that the main memory is byte addressable and that the array is stored startin...
0 votes
0 votes
0 answers
4