0% found this document useful (0 votes)
9 views11 pages

DS - Unit - 1 - ADT & Address Calculation

Uploaded by

akshit23153075
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views11 pages

DS - Unit - 1 - ADT & Address Calculation

Uploaded by

akshit23153075
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Some Extra Topics ( UNIT 1)

Note – Dear Students apart from the topics discussed in the class it is suggested to
you to prepare the following topic s also from Unit 1.

Topic 1 – ABSTRACT DATA TYPES


Abstract data types, commonly abbreviated ADTs, are a way of classifying data
structures based on how they are used and the behaviors they provide.

They do not specify how the data structure must be implemented or laid out in
memory, but simply provide a minimal expected interface and set of behaviors.

For example, a stack is an abstract data type that specifies a linear data structure
with LIFO (last in, first out) behavior. Stacks are commonly implemented using
arrays or linked lists, but a needlessly complicated implementation using a binary
search tree is still a valid implementation.

An array can be used as a stack. Likewise, a stack can be implemented using an


array.

Abstract Data Type Other Common Names Commonly Implemented with

List Sequence Array, Linked List

Queue Array, Linked List

Double-ended Queue Dequeue, Deque Array, Doubly-linked List

Stack Array, Linked List


List as Abstract Data Type

Lists are linear data structures in which data is stored in a non - continuous fashion.
List consists of data storage boxes called 'nodes'.

These nodes are linked to each other i.e. each node consists of the address of some
other block. In this way, all the nodes are connected to each other through these
links.

The List ADT Functions is given below:

get() – Return an element from the list at any given position.

insert() – Insert an element at any position of the list.

remove() – Remove the first occurrence of any element from a non-empty list.

removeAt() – Remove the element at a specified location from a non-empty list.

replace() – Replace an element at any position by another element.

size() – Return the number of elements in the list.

isEmpty() – Return true if the list is empty, otherwise return false.

isFull() – Return true if the list is full, otherwise return false.

Stack ADT

Stack is a linear data structure in which data can be only accessed from its top. It
only has two operations i.e. push (used to insert data to the stack top) and pop
(used to remove data from the stack top).
Functions related o Stack are given below

push() – Insert an element at one end of the stack called 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

Queue ADT

Queue is a linear data structure in which data can be accessed from both of its ends
i.e. front and rear. It only has two operations i.e. push (used to insert data to the
rear of the queue) and pop (used to remove data from the front of the queue).

Function related to queue are given below

enqueue() – Insert an element at the end of the queue.

dequeue() – Remove and return the first element of the queue, if the queue is not
empty.

peek() – Return the element of the queue without removing it, if the queue is not
empty.

size() – Return the number of elements in the queue.

isEmpty() – Return true if the queue is empty, otherwise return false.

isFull() – Return true if the queue is full, otherwise return false.


Features of Abstract Data Type

Abstract data types (ADTs) are a way of encapsulating data and operations on that
data into a single unit. Some of the key features of ADTs include:

Abstraction: The user does not need to know the implementation of the data
structure only essentials are provided.

Better Conceptualization: ADT gives us a better conceptualization of the real


world.

Robust: The program is robust and has the ability to catch errors.

Encapsulation: ADTs hide the internal details of the data and provide a public
interface for users to interact with the data. This allows for easier maintenance and
modification of the data structure.

Data Abstraction: ADTs provide a level of abstraction from the implementation


details of the data. Users only need to know the operations that can be performed
on the data, not how those operations are implemented.
Topic 2 – Array and Linked List Representation of Sparse Matrix
Topic 3 – N Dimensional Array Address Calculation
Some More Examples of Address Calculation

You might also like