Introduction to
Data Structures
Data Structures
• Data structures are ways of organizing and storing data in
computer memory so that they can be accessed and
modified efficiently.
• They are essentially containers that hold data in a specific
layout.
• Examples include arrays, linked lists, stacks, queues, trees,
and graphs.
Data Structures - Applications
• Arrays: Used in applications that require indexed access to
elements, such as image processing where each pixel needs to be
accessed using an index (or indices).
• Stacks: Used in undo functionality in software like text editors or
going back in a web browser, etc.
• Queues: Used in task scheduling systems.
• Trees: Used in databases and file systems to store hierarchical
data.
• Graphs: Used in social networks to represent connections between
users and in GPS (or navigation systems) to find the shortest path.
Efficiency of Data Structures
• Data structures are ways of organizing and storing data to
facilitate efficient operations.
• The efficiency of a data structure is evaluated based on how
quickly and effectively it supports various operations like
accessing, inserting, deleting, updating, and searching for
data.
• Typically, efficiency is divided into
• Time complexity
• Space complexity
Efficiency of Data Structures
• Time Complexity: Measures how the time to perform
operations changes with the size of the data.
• Example
• Array: Accessing an element by index is O(1) (constant time),
but inserting an element in the beginning can be O(n) (linear
time) due to shifting.
Efficiency of Data Structures
• Space Complexity: Measures the amount of memory used
by a data structure as it scales with the size of the data it
contains.
• Examples
• Array: An array with n elements typically has a space
complexity of O(n), as the memory usage grows linearly with
the number of elements.
• Linked List: A linked list generally has a space complexity of
O(n) because each node requires some memory to store the
data and a pointer to the next node.
Common operations on Data
Structures
• Some of the common operations performed on some data
structures are:
• Insertion
• Access
• Search
• Deletion
• Updation
• Traversal
• Sorting

Lec 1 - Introduction to Data Structures.pptx

  • 1.
  • 2.
    Data Structures • Datastructures are ways of organizing and storing data in computer memory so that they can be accessed and modified efficiently. • They are essentially containers that hold data in a specific layout. • Examples include arrays, linked lists, stacks, queues, trees, and graphs.
  • 3.
    Data Structures -Applications • Arrays: Used in applications that require indexed access to elements, such as image processing where each pixel needs to be accessed using an index (or indices). • Stacks: Used in undo functionality in software like text editors or going back in a web browser, etc. • Queues: Used in task scheduling systems. • Trees: Used in databases and file systems to store hierarchical data. • Graphs: Used in social networks to represent connections between users and in GPS (or navigation systems) to find the shortest path.
  • 4.
    Efficiency of DataStructures • Data structures are ways of organizing and storing data to facilitate efficient operations. • The efficiency of a data structure is evaluated based on how quickly and effectively it supports various operations like accessing, inserting, deleting, updating, and searching for data. • Typically, efficiency is divided into • Time complexity • Space complexity
  • 5.
    Efficiency of DataStructures • Time Complexity: Measures how the time to perform operations changes with the size of the data. • Example • Array: Accessing an element by index is O(1) (constant time), but inserting an element in the beginning can be O(n) (linear time) due to shifting.
  • 6.
    Efficiency of DataStructures • Space Complexity: Measures the amount of memory used by a data structure as it scales with the size of the data it contains. • Examples • Array: An array with n elements typically has a space complexity of O(n), as the memory usage grows linearly with the number of elements. • Linked List: A linked list generally has a space complexity of O(n) because each node requires some memory to store the data and a pointer to the next node.
  • 7.
    Common operations onData Structures • Some of the common operations performed on some data structures are: • Insertion • Access • Search • Deletion • Updation • Traversal • Sorting