Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Data Structures Introduction

Data structures are methods for organizing and storing data efficiently, enabling easy access and modification. They can be categorized into linear (e.g., arrays, linked lists) and non-linear structures (e.g., trees, graphs), as well as static (fixed size) and dynamic (variable size) types. Abstract Data Types (ADTs) define the behavior of data structures without specifying their implementation, focusing on the operations that can be performed.

Uploaded by

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

Data Structures Introduction

Data structures are methods for organizing and storing data efficiently, enabling easy access and modification. They can be categorized into linear (e.g., arrays, linked lists) and non-linear structures (e.g., trees, graphs), as well as static (fixed size) and dynamic (variable size) types. Abstract Data Types (ADTs) define the behavior of data structures without specifying their implementation, focusing on the operations that can be performed.

Uploaded by

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

DATA STRUCTURES

INTRODUCTION
What is data structure
• Data structure is a way of organizing and storing data so that it can
be accessed and modified efficiently(Structure for the data).
• Think of it like an arrangement or container that holds data, and each
type of data structure offers different ways to organize and access that
data.

Why Do We Need Data Structures?


• Efficiency: Some operations (like searching, inserting, or deleting data)
can be very slow if the data is not stored in an efficient way.
• Organization: Data structures help you organize your data logically
and in a way that makes it easier to work with.
Types of data structures
• Linear Data Structures
• Non-Linear Data structures
LINEAR DATA STRUCTURES
• A Linear data structure have data elements arranged in sequential manner and each
member element is connected to its previous and next element.

• Ex: Array, Linked list, Stack, Queue.

NON-LINEAR DATA STRUCTURES


• Data structures where data elements are not arranged sequentially or linearly are
called non-linear data structures.

• Every data element may be linked to more than one data elements.

• Ex: Tree, Graph.


STATIC DATA STRUCTURES
• Static data structures have a fixed size, which is determined at the time of creation and cannot
be changed during the program's execution.

• a) The size of the array is fixed. b) You can modify the values inside the array, but you cannot
change the number of elements once it's initialized. c) The memory allocation is contiguous.

• Ex: Array.

DYNAMIC DATA STRUCTURES


• Dynamic data structures can grow and shrink in size during the execution of a program. They
can adapt to the amount of data being handled.

• a) Memory for each node is allocated individually at runtime(DMA). b) Each node has a pointer
that refers to the next node which allows the structure to change dynamically. c) You can easily
add or remove nodes. For instance, you can add a new node at the end, or insert it in the
middle of the list by updating the pointers.

• Ex: Linked List.


DATA TYPES
• Specifies the type of data that a variable can store such as integer, float, character, etc
and the operations which can be performed.

• Ex: Integer, Float, Character.

ABSTRACT DATA TYPES(ADT)


• An ADT is a mathematical model of a data structure that specifies the type of data
stored, the operations supported on them, and the types of parameters of the
operations.

• An ADT specifies what each operation does, but not how it does it.

• Ex: Some examples of ADT are Stack, Queue.


OPERATIONS ON DATA STRUCTURES
• Insertion: We can insert the new element in a data structure.

• Updation: We can update the element, i.e., we can replace the element with another
element.

• Deletion: We can also perform the delete operation to remove the element from the
data structure.

• Searching: We can also search for any element in a data structure.

• Sorting: We can also sort the elements of a data structure either in an ascending or
descending order.
LINKED LIST DIAGRAM
MORE INFO ON ABSTRACT DATA
STRUCTURES
• This refers to a classification of data that defines what kind of value it holds (such as `int`,
`float`, `char`, etc.) and what operations can be performed on it (like arithmetic operations
for `int` or concatenation for `char`). Data types define the *structure* and *storage
format* of data at a low level(deeper),and are closely tied to a specific programming
language.

• This is more of a *concept* or *mathematical model* that defines a *set of operations* on


a collection of data, independent of how the data is stored or implemented. An ADT
describes the *interface* for interacting with the data and the *behavior* of its operations,
but it doesn't specify the underlying data structures or the details of implementation.

• The word "abstract" in ADT emphasizes that the type is described in terms of the
behavior (what it can do), and not in terms of how it is actually implemented. You don't
need to know how the operations (like `push()`, `pop()`, `enqueue()`, etc.) are carried out
internally — you only need to know that they exist and how they behave.

You might also like