Module 3.1 Stacks
Module 3.1 Stacks
• Queues: Introduction
• Array Representation of Queues,
• Linked Representation of Queues
• Types Of Queues: Circular Queue, Priority Queues
Stacks
• Stack is a linear data structure which uses the principle i.e., the elements
in a stack are added and removed only from one end, which is called
the TOP.
• A stack is called a LIFO (Last-In-First-Out) data structure, as the
element that was inserted last is the first one to be taken out.
• The whole procedure will be repeated until all the functions get executed.
• In case the stack is a very small one or its maximum size is known in
advance, then the array implementation of the stack gives an efficient
implementation.
• But if the array size cannot be determined in advance, then the other
alternative, i.e., linked representation, is used.
• All insertions and deletions are done at the node pointed by TOP.