DSA.pptx based on basic dsa concepts for engineers
SaketKumar846792
2 views
9 slides
Feb 20, 2025
Slide 1 of 9
1
2
3
4
5
6
7
8
9
About This Presentation
A basic detail about Data structures
Size: 2 MB
Language: en
Added: Feb 20, 2025
Slides: 9 pages
Slide Content
A PRESENTATION ON : DATA STRUCTURES AND ALGORITHM ASANSOL ENGINEERING COLLEGE DEPARTMENT OF CSE NAME:- SAKET KUMAR ROLL NO.- 10800123175
What Is Data Structure? A data structure is a specialized format for organizing, processing, storing, and retrieving data. It defines the relationship between data elements and the operations that can be performed on them (for different programming languages). Think of it this way: Imagine a library with books as data elements and the library shelves as the data structures. It is easier to browse the vast number of books when they are organized/ categorised into different sections (fiction, non-fiction, etc.). Similarly, data structures provide a systematic way to store and access data based on its type and intended use. Data structures are fundamental to computer science and programming because they provide a means to manage large amounts of data efficiently. In simple terms, data structure definition is- it is a collection of data values and the relation between them, along with the functions or operations that can be applied to the data. They play a critical role in various applications, from databases and operating systems to artificial intelligence and machine learning. However, you must choose the appropriate data structure based on the programming needs and programming languages to write efficient and optimized code.
Types Of Data Structures: 1. Linear Data Structures Linear data structures organize data elements sequentially, where each element is connected to its previous and next adjacent elements. In other words, the data is represented in a sequential or linear order, where elements are arranged one after another, and access typically happens in a specific order (e.g., by index). Its subtypes include- Arrays, Linked Lists, Stacks, and Queues. 2. Non-Linear Data Structures Non-linear data structures do not follow a sequential order, allowing for more complex relationships between data elements. They are crucial for representing hierarchical or interconnected data. Access can be based on keys, positions, or relationships. Its subtypes/ examples include graphs and tree data structures.
ANOTHER TWO TYPES: 3. Hashed Data Structures Hashed data structures use hash functions to compute an index (hash code) into an array of buckets or slots, where data elements are stored. This indexing allows for fast access and retrieval operations. For example: Hash Tables : A data structure that stores key-value pairs, with keys mapped to unique indices using a hash function. Hash Maps : Implementation of associative arrays that map keys to values. Hash Sets : Collection of unique elements where each element is hashed to a unique bucket. 4. Heap Data Structures Heap data structures are specialized binary trees that satisfy the heap property, ensuring the highest (or lowest) priority element is always at the root. They are primarily used to implement priority queues. For example: Binary Heaps : Complete binary tree where every parent node has a value less/greater than or equal to its child nodes. Priority Queues : Abstract data type where elements are retrieved in order of priority.
Significance Of Data Structures: Data Storage: Data structures provide a way to store data in an organized manner, making it easier to manage and access the data efficiently. Data Organization: They organize data in a structured format, such as linear (arrays, linked lists) or non-linear (trees, graphs), facilitating easier data manipulation. Data Processing: They enable efficient data manipulation, including operations like insertion, deletion, and traversal, which are optimized for performance based on the data structure used. Memory Management: They manage memory usage effectively, with some data structures like linked lists and trees dynamically allocating memory as needed. Homogeneous Data: Many data structures store homogeneous data elements, meaning all elements are of the same type, ensuring consistency and predictability.
Asymptotic Notation Asymptotic notation is a way to describe the running time or space complexity of an algorithm based on the input size. It is commonly used in complexity analysis to describe how an algorithm performs as the size of the input grows. The three most commonly used notations are Big O, Omega, and Theta. Big O notation (O): This notation provides an upper bound on the growth rate of an algorithm’s running time or space usage. It represents the worst-case scenario, i.e., the maximum amount of time or space an algorithm may need to solve a problem. For example, if an algorithm’s running time is O(n), then it means that the running time of the algorithm increases linearly with the input size n or less.
ASYMPTOTIC NOTATIONS: Omega notation (?): This notation provides a lower bound on the growth rate of an algorithm’s running time or space usage. It represents the best-case scenario, i.e., the minimum amount of time or space an algorithm may need to solve a problem. For example, if an algorithm’s running time is ?(n), then it means that the running time of the algorithm increases linearly with the input size n or more. Theta notation (?): This notation provides both an upper and lower bound on the growth rate of an algorithm’s running time or space usage. It represents the average-case scenario, i.e., the amount of time or space an algorithm typically needs to solve a problem. For example, if an algorithm’s running time is ?(n), then it means that the running time of the algorithm increases linearly with the input size n.
ASYMPTOTIC NOTATION EXAMPLES AND GRAPHS:- 3n+ 2 =O(n) as 3n+ 2 ≤4n for all n≥ 2 2 . 3n+ 3 =O(n) as 3n+ 3 ≤4n for all n≥ 3