Transcript Slide 1
DEPARTMENT OF TECHNICAL EDUCATION
ANDHRA PRADESH
Name
Designation
Branch
Institute
Year/Semester
Subject
Subject Code
Topic
Duration of Period
Sub. Topic
: S V Kumar
:Head of Section
: Computer Engineering
: Government Polytechnic, Hyderabad
: III-Semester
: Data structure through ‘C’
: 9CM305
: Introduction to Data Structures
: 50 min
: Introduction, Data Structures, & its
Classification
Teaching Aids to be use : Animation Clips & Images
Revised by
: Bapuji naik
9CM305.1
1
OBJECTIVE
On completion of this period, you would be able to
know
• What are Data Structures?
• Definition of Data Structures
• Classification of Data Structures
9CM305.1
2
INTRODUCTION
What is Data?
• A number
• A character
• A string
Examples
• 786
• ‘C’
• “PROGRAMMING”
9CM305.1
3
INTRODUCTION
What is Data Type?
• A range of similar types of data
• Its associated operations
Examples
• integer (–32768 to 32767)
• +, -, *, /, %
9CM305.1
4
INTRODUCTION
Data Type (cont..)
Data types can be broadly categorized into two types
1) Atomic data type
2) Composite data type
9CM305.1
5
INTRODUCTION
Contd…
Atomic data
• A single & inseparable entity
Example
• the number 4568 may be considered as a single integer
value
• You may separate 4568 into four single digit integer, but
they may not represent original meaning of 4568
9CM305.1
6
INTRODUCTION
Contd…
Atomic data types
• A set of atomic values
• A set of operations on those values
9CM305.1
7
INTRODUCTION
Contd…
Example for atomic data types
• Integer
•
•
values:- -2, -1, 0, 1, 2, 765
operation: +,-,*,/……
Float-point
values:- ,……,0.0, 0.1,
2.34, 35.890
operations:+,-,*,/….
Character
values: ‘A’,’B’,……’Z’, ‘a’, ’b’…..
operation:+,-,
9CM305.1
8
INTRODUCTION
Contd…
Data Types – Composite Data
- Separated into subfields that have specified meaning
Composite data type
• A set of composite values
• A set of operations on those values
9CM305.1
9
INTRODUCTION
Contd…
Examples of Composite Data Types
Data
•
values
: 24-04-08
• Separated into day, month, & year
• Operations :add two data values
:subtract two data values
9CM305.1
10
INTRODUCTION
Contd…
What is Data Structure?
• Data + Structure - two words
Try to understand separately
• Data is a value
• Structure means organization & arrangement of data
• Structure also implies a set of rules that hold data to
gather
• It deals with organization of data in computer memory
9CM305.1
11
INTRODUCTION
Contd…
Data Structure (cont..)
• Data structure consists of either data types or another data
structures
• It defines a set of associations or relationships (structure)
that involve combined elements.
• It deals how to store & arrange data in memory
• Also knows how to bring it back from memory – access
• It formulates what operations can perform on the data
9CM305.1
12
INTRODUCTION
Contd…
Examples of Data structure
Almirah
– A varied (heterogeneous ) collection of data like clothes, bangles,
currency notes, utensils, and other data types
– Similar data elements are put together in a rack
– Operations – add(), remove(), search(), replace()
9CM305.1
13
INTRODUCTION
Contd…
Examples of Data structure
Array
– A similar (homogeneous) collection of data or data types
– Data elements are organized sequentially
– Operations – add(), remove(), search(), replace()
9CM305.1
14
INTRODUCTION
Data Structures - Classifications
Contd…
• Primitive Data structures
• Non Primitive Data structures
9CM305.1
15
INTRODUCTION
Contd…
Primitive Data structures
• These are basic data types
• Nothing but primary (set) data types
• Examples are
–
–
–
Integer data types
Float also called real types
Character data types
9CM305.1
16
INTRODUCTION
Contd…
Non Primitive Data structures
-These are complex data structures
Further classified into two types
•Linear Data structures
• Non Liner Data structures
9CM305.1
17
SUMMARY
In this class, you have learnt the following
• Data – number, or character or string value
• Data types – a range of similar data & its possible operations
• Types of data
–
–
Atomic
composite
• Data Structure – storage, access & relationships of data
9CM305.1
18
QUIZ
1) Which is not an atomic data types ?
a) integer
b) float
c) array
d) double
9CM305.1
19
Frequently asked question
1. Define data types.
2. Write the Basic (primitive) Data Types.
3. What is a data structure?
9CM305.1
20