Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary - 24BEYC01 (24beyc01)

Rating
-
Sold
-
Pages
14
Uploaded on
25-05-2025
Written in
2023/2024

data structure notes

Institution
Course

Content preview

UNIT III- STACK
Stack as an ADT - Representation and implementation of Stack using Sequential and Linked
Organization - Applications of Stack - Simulating Recursion using Stack – Arithmetic
Expression Conversion and Evaluation - Time complexity analysis of Stack operations.


STACK as an ADT

• Stack is a linear data structure which follows the principle of Last In First
Out(LIFO). In stack insertion and deletion are done at only one end called top.
• Stack is an abstract data type, which doesn’t define the underlying structure itself.
• Stack only defines a set supported operations that we can we implement by different
concrete data structures (such as arrays or linked lists)

Basic operations:

• push(): Insert an element at one end of the stack called the top.
• pop(): Remove and return the element at the top of the stack, if it is not empty.
• peek(): Return the element at the top of the stack without removing it, if the stack is
not empty.
• size(): Return the number of elements in the stack.
• isEmpty(): Return true if the stack is empty; otherwise, return false.
• isFull(): Return true if the stack is full; otherwise, return false.

, Representation and implementation of Stack using Sequential and Linked
Organization:

Representation of Stack Data Structure:




Representation of Stack Data Structure using sequential organization
(Arrays):

A Stack is a linear data structure that follows the principle of (Last-In-First-Out) LIFO . In
Stack there is one end through which insertion and deletion takes place. Whenever an element
is added in the stack, it is added on the top of the stack, and the element can be deleted only
from the stack. In other words, a stack can be defined as a container in which insertion and
deletion can be done from the one end known as the top of the stack. A stack is a data structure
that can be represented as an array.

An array is used to store an ordered list of elements. Using an array for representation of stack
is one of the easy techniques to manage the data. But there is a major difference between an
array and a stack.

• Size of an array is fixed.
• While, in a stack, there is no fixed size since the size of stack changed with the number
of elements inserted or deleted to and from it.

Despite the difference, an array can be used to represent a stack by taking an array of
maximum size; big enough to manage a stack.

Written for

Institution
Course

Document information

Uploaded on
May 25, 2025
Number of pages
14
Written in
2023/2024
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
vrishtikkavaipavsaran

Get to know the seller

Seller avatar
vrishtikkavaipavsaran
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions