in the last subsection we have implemented a


In the last subsection, we have implemented a stack by using an array. While a stack is implemented by using arrays, it suffers from the basic restriction of an array - i.e., its size cannot be increased or decreased once it is declared. Consequently, one ends up reserving either too much space or too less space for an array and in turn for a stack. This difficulty can be conquering if we implement a stack using a linked list. In the case of a linked stack, we will push and pop nodes from one end of any linked list.

The stack, as linked list is represented as a singly linked list. In the linked list each node contains the data & a pointer which gives location of the next node in the list. Program 2 implements a stack by using linked lists.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: in the last subsection we have implemented a
Reference No:- TGS0263926

Expected delivery within 24 Hours