2. Index
• Definition
• Introduction
• Classification of Data Structures
• Data Type
• Linear Data Structure
• Non-Linear Data Structure
• Storage Structures
• ADT
3. Background . . .
• Data Structure is the most fundamental and building
blocks in computer science and good knowledge of
data structure is a must, to design and develop
efficient software systems.
4. Continue…
• Different kinds of structures are needed to organize different
kinds of data, now computers work with all kinds of data,
computers work with text, images, videos, audios, rational data,
geospatial data and pretty much any kind of data that we have on
this planet, how we store, organize and group data in a
computers matters, because computer deal with really really
large data even with the computational power of machines if we
do not use right kind of data structures, the right kind of logical
structures then our software systems will not be efficient.
5. Continue…
•A Data Structure is a way to store and
organize data in a computer so that, it
can be used efficiently.
•Data Structure
• Mathematical /Logical Models or Abstract Data Type
• Implementation
6. Definition
•Data Structures is representation of the logical
relationship existing between individual
elements of data.
•In other words, a data structure is a way of
organizing all data items that considers a not
only the elements stored but also their
relationship to each other.
7. Introduction
•Data Structure affects the design of both
structural and functional aspects of a program.
Program=algorithm + Data Structure
•Algorithm is a step by step procedure to solve a
particular function.
8. Continue…
• That means, algorithm is a set of instruction written
to carry out certain tasks & the data structure is the
way of organizing the data with their logical
relationship retained.
• To develop a program of an algorithm, we should
select an appropriate data structure for that algorithm.
• Therefore algorithm and its associated data structures
from a program.
9. Classification of Data Structure
•Data structure are normally divided into two
broad categories:
•Primitive Data Structure
•Non-Primitive Data Structure
11. Data Type
•A particular kind of data item, as defined by the
values it can take, the programming language
used, or the operations that can be performed.
12. Primitive Data Structure
• Primitive Data Structures are basic structures and
directly operated upon by machine instructions.
• Primitive data structures have different representations
on different computers.
• Integers, floats, character and pointers are examples of
primitive data structures.
13. Continue…
• Theses data types are available in most programming
languages as built in type.
• Integer: It is a data type which allows all values without fraction
part.
• Float: It is a data type which use for sorting fractional numbers.
• Character: Used for character values.
• Pointer: A variable that holds memory address of another
variable are called pointer.
14. Non-Primitive Data Structure
• These are more sophisticated data structures.
• These are derived from primitive data structures.
• The non-primitive data structures emphasize on
structuring of a group of homogeneous or
heterogeneous data items.
• Examples of Non-primitive data type are Array, List
and Files etc.
15. Continue…
• A Non-primitive data structure is further divided into
Linear and Non Linear Data structure.
• Array: An array is a fixed-size sequenced collection of
elements of the same data type.
• List: An ordered set containing variable number of
elements is called as Lists.
• File: A file is a collection of logically related information.
It can be viewed as a large list of records consisting of
various fields.
16. Linear Data Structure
• A data structure is said to be Linear, if its elements are connected
in linear fashion by means of logically or in sequence memory
locations.
• There are two ways to represent a linear data structure in
memory,
• Static memory allocation
• Dynamic memory allocation
• The possible operations on linear data structure are : Traversal,
Insertion, Deletion, Searching, Sorting and Merging.
• Examples; Stack and Queue
17. Non-Linear Data Structure
• Non-linear data structures are those data structure in
which data items are not arranged in a sequence.
• Example: Tree and Graph
• Tree: A tree is a data structure made up of nodes or
vertices and edges without having any cycle.
• Graph: A set of items connected by edges. Each
item is called a vertex or node.
19. Continue…
Linear Data Structure
• Every item is related to its
previous and next time.
• Data is arranged in Linear
sequence.
• Data items can be traversed in
single run.
• Example: Array, Stack, Linked
list, Queue.
• Implementation is easy.
Non-Linear Data Structure
• Every item is attached with many
other items.
• Data is not arranged in sequence.
• Data cannot be traversed in a
single run.
• Examples; Tree, Graph.
• Implementation is difficult.
20. Storage Structures
•Categories of storage Structures
•Sequential Storage Data Structures
•Linked Storage Data Structures
•Sequential Access Data Structures
•Random Access Data Structures
22. Continue…
•Linked Storage Data Structures
• Elements may not be stored in consecutive
memory locations. There will be a link between
consecutive elements in the data structure though.
• Example: Linked List When it comes to accessing a data
structure
23. Continue…
•Sequential Access Data Structures
• In order to access a particular location, if we have to pass all
locations sequentially to reach a location, we call
it sequential access.
• Example: Linked list, stacks, queues.
24. Continue…
•Random Access Data Structures
• Can accessed from any location at any point of
time in this type of data structure.
• Example: Arrays
25. ADT
• An abstract data type (ADT) is a mathematical model for a
certain class of data structures that have similar behavior.
• Abstract Data Types (ADT's) are a model used to understand the
design of a data structure.
• 'Abstract ' implies that we give an implementation-independent view
of the data structure.
• ADTs specify the type of data stored and the operations that support
the data.
• Viewing a data structure as an ADT allows a programmer to focus on
an idealized model of the data and its operations.
26. Array
• An array is an aggregate data structure that is designed to store a
group of objects of the same or different types.
• Arrays can hold primitives as well as references. The array is the
most efficient data structure for storing and accessing a sequence of
objects.
• An array is a data structure consisting of data items of the same type
data items of the same type.
• Arrays are static data structures that stay the same size throughout the
program.
27. Continue…
• An Array is:
• A collection of contiguous memory locations.
• Same name
• Same type
• Locations (elements) in the array are Locations (elements) in
the array are referenced by
• array name
• position within the array
• index notation: a[0] refers to the first element of array a, a[1] refers
to the second element of array a, etc.