Data Structures Introduction
Data Structures Introduction
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.
• Every data element may be linked to more than one data elements.
• 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.
• 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.
• An ADT specifies what each operation does, but not how it does it.
• 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.
• 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.
• 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.