0% found this document useful (0 votes)
6 views

Unit 1

Uploaded by

Manas Kagankar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Unit 1

Uploaded by

Manas Kagankar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Data Structures & Algorithms

(Lecture 03)

Prof. P. T. Sawant
Asst. Prof.
Department of Computer Science & Information
Technology
Unit1
Introduction
Agenda
 Definition of Data Structures

 Need of Data Structures

 Areas in which Data Structures are applied

 Types of Data Structures

 Applications of Data Structures

 Operations
What is Data Structure?
• A data structure is a systematic way of organizing
and accessing data

• Logical or mathematical model of a particular


organization of data is called data structure

• In computer science, a data structure is a particular


way of storing and organizing data in a computer’s
memory so that it can be used efficiently
Need of Data Structures
Unit1
Need of data structure
• It gives different level of organization data

• It tells how data can be stored and accessed in its


elementary level
• Provide operation on group of data, such as adding an item,
looking up highest priority item
• Provide a means to manage huge amount of data efficiently

• Provide fast searching and sorting of data


Areas in which data structures are applied extensively

• Compiler Design
• Operating System
• Database Management System
• Numerical Analysis
• Computer Graphics
• Artificial Intelligence- Machine Learning
• Simulation
Types of data structure
• Primitive Data Structure: The data structure which is directly
operated by machine level instruction. E.g. int, float, char,
double, pointers

• Non Primitive Data Structure: The data structure which is not


directly operated by machine level instruction.
Non-primitive data structure
It’s further classified in linear and nonlinear data structure.
a) Linear data structure: In linear data structure the item are
arrange in linear sequence like an array.
b) Nonlinear data structure: In this data structure items are not
in sequence.
Linear data structure
Data structure is said to be linear if the
elements form a sequence.

i.e., while traversing sequentially, we can reach


only one element directly from another.

For example : Array, Linked list, Queue etc.


examples
Non linear data structure
Elements in a non linear data structure do not
form a sequence
i.e. each item or element may be connected
with two or more other items or elements in
a non-linear arrangement
Non-Primitive data structure
1.Static Data Structure : Static data structure are those whose
size and structure associated with memory location are
fixed at compile time
e.g. Array int no[5]

2.Dynamic Data Structure : Dynamic structures are those


which expand or shrink as required during the program
execution.
e.g. Linked List
Homogeneous and heterogeneous
data structures

• Homogeneous data structures: elements of same data type


Eg. array
• Heterogenous data structures: elements of different data type
Eg. Linked list
Quiz
Classify following data structures in linear
and non linear
1.Tree
2.Array
3.Linked List
4.Stack
5.Graph
6.Queue
Applications in Computer science field

• RDBMS = Array (i.e. Array of structures)


• Network data model = Graph
• Hierarchical data model = Trees
DATA STRUCTURE
OPERATIONS
• Data structure is used for the storage of data in
computer so that data can be used efficiently
• Selection of data structures for the application
depends on the frequency of the operation needs to
be performed.
The following operations play a major role on data
structures.
a) Creation
b) Inserting : adding a new record to the structure.
c) Deleting : removing a record from the structure.
d)Traversing : accessing each record exactly once so that
certain items in the record may be processed.
e) Searching : finding the location of the record with a given
key value, or finding the locations of all records, which
satisfy one or more conditions.
f) Destroying:

• Sometimes two or more of these operations may be used


in a given situation. For example, if we want to delete a
record with a given key value, at first we will have need to
search for the location of the record and then delete that
record.
• The following two operations are also used in some
special situations :
g) Sorting : operation of arranging data in some given order,
such as increasing or decreasing, with numerical data, or
alphabetically, with character data.
h) Merging : combining the records in two different sorted
files into a single sorted file.
1.List out the areas in which data structures are applied
extensively? (asked in TCS)
2. What is Data Structure?
3 Which are the types of data structure? State the type of
array data structure.
4. What is the need of data structure?
Selecting a data structure
1. Analyze the problem to determine the resource constraints a
solution must meet.
2. Determine basic operation that must be supported. Quantify
resource constraint for each operation
3. Select the data structure that best meets these requirements.
4. Each data structure has cost and benefits. Rarely is one data
structure better than other in all situations.

A data structure require :


• Space for each item it stores
• Time to perform each basic operation
• Programming effort.
• Each problem has constraints on available time and space. Best
data structure for the task requires careful analysis of problem
characteristics.
Thank You

You might also like