Lecture 1: Introduction To Data Structures

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

Data Structures

Lecture 1: Introduction to Data Structures

By
Ravi Kant Sahu
Asst. Professor
Lovely Professional University, Punjab
Contents
• Basic Terminology
• Classification of Data Structures
• Data Structure Operations
• Review Questions

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Basic Terminology
• Data: are values or set of values.

• Data Item: is a single unit of values.

• Data Items are divided into two categories:


• Group Items: Data items that are divided into
sub-items.
• Elementary Items: Data items that are not
divided into sub-items.
Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India
Data Structures

Arrangement of Data to simplify the processing

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Data Structure
• Organization of data needed to solve the
problem.

“ Logical or mathematical model of a particular


organization of data is called a Data Structure.”

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Classification of Data Structures
Data Structures

Primitive Non-Primitive
Data Structures Data Structures
• Integer
Linear Non-Linear
• Real Data Structures Data Structures
• Character
• Boolean • Array • Tree
• Stack • Graph
• Queue
• Linked List

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Data Structure Operations
Data Structures are processed by using certain operations.
1. Traversing: Accessing each record exactly once so that
certain items in the record may be processed.

2. Searching: Finding the location of the record with a given


key value, or finding the location of all the records that satisfy
one or more conditions.

3. Inserting: Adding a new record to the structure.

4. Deleting: Removing a record from the structure.


Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India
Special Data Structure-Operations

• Sorting: Arranging the records in some logical order


(Alphabetical or numerical order).

• Merging: Combining the records in two different sorted


files into a single sorted file.

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Why so many Data Structures?
Questions
Review Questions
• What is the difference between Data and Information?
Explain with example.

• What is the difference between Linear and Non-Linear


Data Structure?

• Differenciate between Sorting and Merging.

• How Searching is different from Traversing?

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India


Linear Vs Non-Linear Data Structure

• LDS is sequential in nature i.e. every data item is


related to its previous and next data item only.

• In LDS, data can be traversed in a single run only.

• Implementation of Non-linear DS is difficult.

• Example: LDS- Array, Linked List, Queue, Stack etc.


• Non-linear DS- Tree and Graphs

Ravi Kant Sahu, Asst. Professor @ LPU Phagwara (Punjab) India

You might also like