0% found this document useful (0 votes)
5 views7 pages

Lecture 1

Data structures are methods for organizing and storing data in computers to enable efficient access and modification. They are crucial for optimizing operations, handling large datasets, and solving complex problems. Data structures can be categorized into primitive and non-primitive types, with various operations like insertion, deletion, traversal, searching, and sorting applicable to them.

Uploaded by

aleezaarshad397
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

Lecture 1

Data structures are methods for organizing and storing data in computers to enable efficient access and modification. They are crucial for optimizing operations, handling large datasets, and solving complex problems. Data structures can be categorized into primitive and non-primitive types, with various operations like insertion, deletion, traversal, searching, and sorting applicable to them.

Uploaded by

aleezaarshad397
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to Data Structures

What are Data Structures


Data: Information stored in computers, such as
numbers, text, or media.
Structure: Refers to the organization of data (e.g.,
sequential in an array or hierarchical in a tree).
Data Structure: A data structure is a way of organizing
and storing data in a computer so it can be accessed and
modified efficiently. It defines the relationship between
data and the operations you can perform on it.

2
Importance
Without proper data structures, solving even simple
problems can become inefficient or even infeasible,
especially when the volume of data increases.

3
Why Learn Data Structures?
Optimization: Allows for faster execution of operations
like searching, sorting, or updating data.
Scalability: Helps in handling large datasets efficiently.
Problem Solving: Enables solving complex
computational problems like shortest path in a graph,
balanced parenthesis checking, etc.

4
Types of Data Structures
1. Primitive Data Structures:
• Simple data types like integers, floats, characters, and
booleans.
• Directly supported by programming languages.
2. Non-Primitive Data Structures:
More complex structures derived from primitive types.
• Linear Data Structures:
Data is arranged sequentially.
Examples: Arrays, Stacks, Queues, Linked Lists.
• Non-Linear Data Structures:
Data is arranged hierarchically or connected arbitrarily.
Examples: Trees (like family trees) and Graphs (like a city
map). 5
Examples:
• Array: Continuous block of memory storing multiple
items of the same type.
• Stack: A collection of items where the last added
item is the first to be removed (LIFO).
• Queue: A collection of items where the first added is
the first to be removed (FIFO).
• Tree: A hierarchical structure with a root node and
child nodes.
• Graph: Represents relationships between items (e.g.,
cities connected by roads).

6
Operations on Data Structures
• Insertion: Adding a new element to the data
structure.
• Deletion: Removing an element.
• Traversal: Visiting each element in the structure
(e.g., reading all items in a list).
• Searching: Finding a specific element.
• Sorting: Arranging elements in a specific order (e.g.,
ascending or descending).

You might also like