Introduction To Data
Structures
Data Structures & Algorithms
Represented By
Nale Rajesh K.
(Lecturer COE Malegaon (Bk))
Sunday, April 14, 202 1
4
What is Data.?
In computing, data is information that has
been translated into a form that is more
convenient to move or process.
Relative to today's computers and
transmission media, data is information
converted into binary digital form.
Distinct pieces of information, usually
formatted in a special way.
Sunday, April 14, 2024 2
Data Objects
Anything that exists in storage and on
which operations can be performed.
Examples include files, Programs and
arrays.
Sunday, April 14, 2024 3
Data Types
The mathematical properties and
internal representation of data and
functions.
An attribute used for defining data as
numeric or character.
Sunday, April 14, 2024 4
A Data Type is characterized by..
a set of values
a data representation, which is
common to all these values, and
a set of operations, which can be
applied uniformly to all these
values
Sunday, April 14, 2024 5
Abstract Data Types
An Abstract Data Type (ADT) is:
a user defined data type
a set of values
a set of operations, which can be applied
uniformly to all these values.
Sunday, April 14, 2024 6
ADT = properties + operations
An ADT describes a set of objects sharing
the same properties and behaviors
The properties of an ADT are its data
(representing the internal state of each object
double d; -- bits representing exponent &
mantissa are its data or state
The behaviors of an ADT are its operations or
functions (operations on each instance)
sqrt(d) / 2; //operators & functions are
its behaviors
Sunday, April 14, 2024 7
Benefits Of ADT
encapsulation: less to worry about
division of labor
promotes code sharing
cheaper sub-contracts
facilitates unit-testing
Sunday, April 14, 2024 8
List Abstract Data Type (ADT)
The List ADT models a Accessor methods:
sequence of positions first(), last()
storing arbitrary objects prev(p), next(p)
It establishes a Update methods:
before/after relation replace(p, e)
between positions insertBefore(p, e),
Can be implemented in insertAfter(p, e),
various ways: insertFirst(e), insertLast(e)
array remove(p)
singly-linked convenience methods:
doubly-linked isEmpty()
Sunday, April 14, 2024 9
Data Structures
Arrangement of data in computer’s
memory.
Goal: to organize data
Criteria: to facilitate efficient
storage of data
retrieval of data
manipulation of data
Design Issue:
select and design appropriate data types.
Sunday, April 14, 2024 10
Primitive & Non-Primitive
Primitive Data Structures
Data can be structured at the most primitive level, where they
are directly operated upon by machine-level instructions.
At this level, data may be character or numeric, and numeric
data may consist of integers or real numbers.
Non-Primitive Data Structures
Non-primitive data structures can be classified as arrays, lists,
and files.
An array is an ordered set which contains a fixed number of
objects.
A list, by contrast, is an ordered set consisting of a variable
number of elements.
A file is typically a large list that is stored in the external
memory of a computer.
Sunday, April 14, 2024 11
Linear & Non-Linear
Linear Data Structure
Linear data structure is linear if element is adjacent to each
other. It has exactly two neighbors elements to which it is
connected as its previous and next member
Array , Linked List , Stack , Queuenumbers.
Non- Linear Data Structures
Non-Linear data structure is that if one element can be
connected to more than two adjacent element then it is
known as non-linear data structure..
Tree , Graph
Sunday, April 14, 2024 12
Static Data Structures
a simple data structure, the array is
static data structure.
They are linear only
They're essentially fixed-size.
They often use too much space.
Sunday, April 14, 2024 13
Dynamic Data Structure
Is one that can grow or shrink as needed to
contain the data you want stored.
That is, you can allocate new storage when
it's needed and discard that storage when
you're done with it.
malloc(), calloc() functions in C language.
Dynamic data structures generally consist
of at least some simple data storage, along
with a linkage to the next element in the
structure.
These links are often called pointers, or
references.
Sunday, April 14, 2024 14
Persistent & Ephemeral
Persistent
One that is continue in existence
Ephemeral
lasting or of use for only a short time;
transitory
Sunday, April 14, 2024 15