This document provides an introduction to data structures. It defines data as a set of values and information as processed data. It distinguishes between primitive and non-primitive data structures. Primitive structures are fundamental data types like integers and floats, while non-primitive structures are built from primitive types, such as lists, stacks, queues, trees and graphs. Linear structures like arrays, stacks and queues store elements in a sequential order, while non-linear structures like trees and graphs distribute elements across a plane in a non-sequential way. Common non-primitive structures are described in more detail, including their properties and uses.
2. Data and Information
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
2
• Data –Set of values
• Example:28/6/2015,jeeva,6
• Information –processed Data
• Example
• name-jeeva
• Dob-28/6/2015
• Age-5
5. Definition
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
5
• Data Structure is a way of storing and organizing data in a
computer so that it can be used efficiently.
• Data structure is representation of the logical relationship
existing between individual elements of data.
6. Categories of Data Structure
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
6
7. Primitive data Structure
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
7
• Primitive data structures are the fundamental data types
which are supported by a programming language.
• Integer, Floating-point number, Character constants,
string constants, pointers etc, fall in this category.
8. Non-Primitive Data Structures
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
8
• Non prinmitive data structures are those data structures which are created
using primitive data structures.
• The non-primitive data structures emphasize on structuring of a group
of homogeneous (same type) or heterogeneous (different type) data
items.
• Lists, Stack, Queue, Tree, Graph are example of non-primitive data
structures.
• The design of an efficient data structure must take operations to be
performed on the data structure
9. Non Primitive Data Structure
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
9
10. Linear Data Structure
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
10
• If the elements of a data structure are stored in a linear or sequential
order,then it’sa linear data structure
• Example-array,stack,queue
11. Array
An array is defined as a set of finite number of homogeneous elements or same data items.
It means an array can contain one type of data only, either all integer, all float-point
number or all character.
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
11
12. Linked List
Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda 12/2/2020
12
•
13. Stack
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
13
• LIFO(Last In First Out)
• Stack is an ordered collection of homogeneous data elements where the
insertion and deletion operations take place at one end only…
14. Queue
• FIFO(First In First Out)
• Queue is open at both its ends. One end is alwaysused to insert data and
the other is used to remove data
Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda 12/2/2020
14
15. Non –Linear Data Structure
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
15
• If the elements of a data structure are not stored in a sequential order then
it’sa non linear data structure.all the elements distributed over a plane.
• Example-Tree,graph
16. Graph
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
16
• Agraph is a group of vertices and edges where an edge connects a pair of
vertices.
• Vertices on the graph are shown as point or circles and edges are drawn
as arcs or line segment.
• Definition: A graph G(V,E) is a set of vertices V and a set of edges E.
17. Tree
12/2/2020Dincy R Arikkat,,Christ college Autonomous Irinjalakkuda
17
• Atree is a nonlinear hierarchical data structure that consists of nodes
connected by edges.
• There is a specially designated node called root
• The first node of the tree is called root node.
• If this root node is connected by another node, the root is then parent node,
and the connected node is a child.