Professional Documents
Culture Documents
Subject Code: Subject Name:: CS8391 Data Structures
Subject Code: Subject Name:: CS8391 Data Structures
Subject Code: Subject Name:: CS8391 Data Structures
14-08-2021 CS8391-DataStructures 1
EVOCATION
14-08-2021 CS8391-DataStructures 2
EVOCATION
14-08-2021 CS8391-DataStructures 3
UNIT -1
14-08-2021 CS8391-DataStructures 4
Data Structures & Abstract Data Types(ADT)
14-08-2021 CS8391-DataStructures 5
History of Programming
SPAGHETTI CODE
(non structured ,Linear
Program)
MODULAR
PROGRAMMING
(Programs into function)
STRUCTURED
PROGRAMMING
(uses control flow constructs)
14-08-2021 CS8391-DataStructures 6
Atomic Data and Composite Data
Atomic data:
• Atomic data are data that consist of a single piece of information.
• For example, the integer 4562 may be considered a single integer value.
• we can decompose it into digits, but the decomposed digits do not have the same
characteristics of the original integer; they are four single-digit integers ranging from
0 to 9.
14-08-2021 CS8391-DataStructures 7
Composite Data:
• Composite data can be broken out into subfields that have meaning.
• A telephone number actually has three different parts. First, there is the area code.
• Then, what you consider to be your phone number is actually two different data items, a prefix
consisting of a three-digit exchange and the number within the exchange, consisting of 4 digits
14-08-2021 CS8391-DataStructures 8
Data Type
• A data type consists of two parts:
14-08-2021 CS8391-DataStructures 9
Data Structure
• A data structure is an aggregation of atomic and composite data into a set with defined
relationships.
• In this definition structure means a set of rules that holds the data together.
• Data structures can be nested. We can have a data structure that consists of other data structures.
14-08-2021 CS8391-DataStructures 10
Why Data Structures?
Program = DS + Algorithm
✔ Data structures and Algorithms are the nuts-and-bolts used by programmers to store and
manipulate the data efficiently in computer memory.
✔ Data structure is a particular way of storing and organizing information in a computer so that it
can be retrieved and used most productively.
14-08-2021 CS8391-DataStructures 11
Definition of Data Structures
• A data structure is a particular way of storing and organizing data in a computer memory
efficiently.
• If the data are stored in a particular format, then it will be easy for processing and retrieval of
those data.
14-08-2021 CS8391-DataStructures 12
What do you meant by Efficient Program?
Efficient program is determined by its time and space complexity.
• Time complexity states the time needed to execute (compile as well as run time) a given
program.
• Space complexity states the memory space needed to store and process the program.
14-08-2021 CS8391-DataStructures 14
Primitive Data Structures
• The data structures which are designed using primitive data structures are called non-primitive data
structures.
• They are used to store a collection of data. It can be categorized into two parts:
14-08-2021 CS8391-DataStructures 15
Contd..
14-08-2021 CS8391-DataStructures 16
Contd..
14-08-2021 CS8391-DataStructures 17
• Array:
• Stack:
• Queue:
• Linked List:
14-08-2021 CS8391-DataStructures 18
• Graph:
• Tree:
14-08-2021 CS8391-DataStructures 19
Application of Data Structures
• The field of computer science will address the task of storing, accessing & manipulating data.
• DS & algorithm are common to almost all application of computer science. Some of the applications are,
Compiler design
Operating System
Data Base Management System
Networking
Graphics
Artificial Intelligence
Statistical analysis
System software design
Robotics etc.,
14-08-2021 CS8391-DataStructures 20
Contd..
Difference between datatype and data structure:
Data type:
Data structure:
14-08-2021 CS8391-DataStructures 21
MIND MAP
14-08-2021 CS8391-DataStructures 22
Summary
Introduction to Data Structures
• Why data structures?
• Definition of Data Structure
• Classification of data structures
• Linear
• Non-linear
• Applications of Data Structures
• Abstract Data Types (ADTs)
• Definition of ADT
• Why ADT?
• Modular Programming
14-08-2021 CS8391-DataStructures 23