0% found this document useful (0 votes)
2 views

Introduction Of Data Structure And Algorithms

The document provides an overview of various data structures, categorizing them into linear, non-linear, hash-based, advanced, and specialized structures, along with their operations and applications. It outlines basic operations such as insertion, deletion, traversal, searching, sorting, and merging that can be performed on these data structures. Additionally, it discusses criteria for choosing a data structure based on access efficiency, insertion/deletion costs, memory usage, and application-specific needs.

Uploaded by

dg107835
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Introduction Of Data Structure And Algorithms

The document provides an overview of various data structures, categorizing them into linear, non-linear, hash-based, advanced, and specialized structures, along with their operations and applications. It outlines basic operations such as insertion, deletion, traversal, searching, sorting, and merging that can be performed on these data structures. Additionally, it discusses criteria for choosing a data structure based on access efficiency, insertion/deletion costs, memory usage, and application-specific needs.

Uploaded by

dg107835
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

A data structure is a specific way to store, organise, and manage data in

a computer, which allows efficient operations such as insertion,


traversal, deletion, searching, sorting, and merging.
1. Linear Data Structures

•Array: A collection of elements identified by an index or key. All elements are stored in contiguous memory
locations.
•Example: [10, 20, 30, 40]

•Linked List: A sequence of nodes where each node contains data and a pointer to the next node.
•Types: Singly Linked List, Doubly Linked List, Circular Linked List.

•Stack: A collection of elements that follows the Last In, First Out (LIFO) principle.
•Example Operations: Push, Pop, Peek.

•Queue: A collection of elements that follows the First In, First Out (FIFO) principle.
•Variants: Circular Queue, Priority Queue, Deque (Double-ended Queue).
2. Non-Linear Data Structures
Tree: A hierarchical data structure where data is organized into nodes,
starting with a root node.
Types: Binary Tree, Binary Search Tree (BST), AVL Tree, B-Trees, etc.
Graph: A collection of nodes (vertices) connected by edges.
Types: Directed, Undirected, Weighted, Unweighted, etc.
3. Hash-Based Structures
Hash Table: A structure that maps keys to values using a hash function for
efficient lookups.
Applications: Caching, Dictionary implementations.
4. Advanced Data Structures
Heap: A specialized tree-based structure that satisfies the heap property
(Min-Heap or Max-Heap).
Trie: A Trie (pronounced "try") is a specialized tree-like data structure
used primarily for storing and searching strings, especially useful for
managing a dynamic set of strings like a dictionary or prefix-based
search..
Disjoint Set (Union-Find): A Disjoint Set (also known as Union-Find) is a
data structure that tracks a partition of elements into disjoint (non-
overlapping) subsets. It is particularly useful in applications involving
dynamic connectivity, such as Kruskal's algorithm for Minimum Spanning
Tree (MST) and network connectivity problems.
5. Specialized Structures
Matrix: A two-dimensional array used for mathematical computations
or graphics.
Sparse Table: Efficient for range query problems like finding
minimum/maximum in a range.
Criteria for Choosing a Data Structure
Access Efficiency: How quickly data can be retrieved.
Insertion/Deletion: The cost of adding or removing elements.
Memory Usage: How much space is required.
Application-Specific Needs: The structure's adaptability to the problem (e.g., graph algorithms, databases,
etc.).
Basic operations in data structures involve manipulating and managing data
effectively. Here are the common operations, applicable across various data
structures:
1. Insertion
Description: Adding a new element to the data structure.
Examples:
Adding a value to an array or linked list.
Inserting a node in a binary tree or graph.
Enqueuing in a queue or pushing onto a stack.

2. Deletion
Description: Removing an existing element from the data structure.
Examples:
Removing an element from an array by index.
Deleting a node in a linked list or tree.
Popping from a stack or dequeuing from a queue.
3. Traversal
Description: Visiting each element of the data structure in a systematic way.
Examples:
Iterating through an array or linked list.
Performing in-order, pre-order, or post-order traversal in trees.
Exploring a graph using Depth First Search (DFS) or Breadth First Search (BFS).

4. Searching
Description: Locating an element in the data structure.
Examples:
Linear search in an array or linked list.
Binary search in a sorted array or binary search tree.
Searching in a graph using algorithms like BFS/DFS.

5. Sorting
Description: Arranging elements in a specific order (ascending or descending).
Examples:
Bubble Sort, Merge Sort, Quick Sort, etc., for arrays.
Sorting linked list nodes or heap-based structures.
6. Accessing
Description: Retrieving the value of an element.
Examples:
Accessing an array element using an index.
Accessing the top of a stack or front of a queue.
Accessing a node in a tree using a path.

7. Updating
Description: Modifying the value of an existing element.
Examples:
Updating a value in an array by its index.
Changing the key value in a heap or node value in a linked list.
8. Merging
Description: Combining two data structures of the same type into one.
Examples:
Merging two sorted arrays or linked lists.
Combining two heaps or trees.
9. Splitting
Description: Dividing a data structure into smaller parts.
Examples:
Splitting an array into two sub-arrays.
Dividing a linked list into two halves.

10. Resizing
Description: Adjusting the size of a dynamic data structure.
Examples:
Expanding a dynamic array when full.
Contracting an array when it becomes underutilized.
11. Union and Intersection

You might also like