This document provides an introduction to data structures and algorithms. It defines key concepts like algorithms, programs, and data structures. Algorithms are step-by-step instructions to solve a problem, while programs implement algorithms using a programming language. Data structures organize data in a way that allows programs to use it effectively. The document discusses abstract data types (ADTs), which specify operations that can be performed on data instances along with preconditions and postconditions defining what the operations do. Common ADT operations include constructors, access functions, and manipulation procedures. An example dynamic set ADT is provided to illustrate defining operations and axioms.
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Introduction to Data Structure.pptx
1. Introduction to Data Structure
By
Dr. Mousumi Dhara
Assistant Professor
Department of Computer Science and Engineering
JIS University, Kolkata
West Bengal, India
2. Concepts of data structures
Algorithm: outline, the essence of a computational procedure,
step by step instructions.
Program: An implementation of an algorithm in some
programming language.
Data structure: Organization of data needed to solve the problem.
DS is the way we need to organize the data, so that it can be used
effectively by the program.
So you are all familiar with certain data structures, like an array,
or a list for instance.
Algorithmic problem is essentially, that you have a certain
specifications of an input and certain you specify what the output
should be like.
3. Continue…..
• Here is one specification, a sorted, non-decreasing sequence of
natural number of non zero finite length.
• For example : a sorted, non-decreasing sequence of natural
numbers of non zero finite length: 1, 20, 908, 909, 100000,
1000000000
• So, an algorithm is essentially, describing the actions that one
should take on the input instance to get the output as desired as
is specified. There can be infinitely many input instance and
there can be infinitely many algorithms for solving certain
problem
5. ADT(Abstract Data Type)
• ADT is a mathematically specified entity that
defines a set of it’s instances with:
a specific interface– a collection of
signatures of operations that can be invoked
on an instance.
a set of axioms(preconditions and
postconditions) that define the semantics of
the operations (i.e., what the operations do to
instances of the ADT, but not how)
6. ADT: Description
• It is basically a specification of what the instances are
and what are the set of axioms that define the
semantics of the operation on those instance.
• Like addition of two integer number in mathematics,
here we define certain operations on those data types.
• And those operations would be defined through what
is called an interface which basically gives us what is
called as signature of the operations (the parameters
that the operation requires and so on))
• We will also specify what are the results of those
operation through a set of axioms.
7. ADT: Types of Operation
• Constructors: create an instance of that
particular data type.
• Access functions: Functions which let us to
access elements of the data type. Example like
ISIN()
• Manipulation procedures: it would let us to
manipulate or modify the data type. Example
like Insert, Delete
8. ADT: Example
• Dynamic set: Methods
New(): ADT // creating
Insert(S:ADT, v: element):ADT
Delete (S: ADT, v:element):ADT
ISIN(S: ADT, v:element): Boolean
• Axioms that define the methods:
ISIN (New(), v)=false
ISIN (Insert(S, v), v)= true
ISIN(Insert(S,u), v)=ISIN(S,v), if v ≠u
ISIN(Delete(S,v),v) = false
ISIN (Delete(S,u),v)= ISIN (S,v) if v ≠u
9.
10. Another way defining ADT
A useful tool for specifying the logical properties of a
data type is the abstract data type or ADT
Fundamentally, a data type is a collection of values and
a set of operations on those values.
That collection and those operations form a
mathematical construct that may be implemented
using a particular hardware or software data structure.
The term “abstract data type” refers to the basic
mathematical concept that defines the data type
In defining an abstract data type as a mathematical
concept, we are not concerned with space and time
efficiency.