0% found this document useful (0 votes)
17 views2 pages

Data Structures Course Overview

This document outlines the course CSE228: Data Structures. The course aims to teach students how to analyze algorithm efficiency using asymptotic notations, illustrate the importance of queues in problem solving, differentiate between HashTables and HashMaps, identify appropriate data structures like HashSets and trees for problems, and analyze the effectiveness of priority queues and heaps. The course covers stacks, queues, hash tables, hash maps, hash sets, binary trees, binary search trees, priority queues, heaps, and graphs through both theory and practical sessions. Key textbooks and references are also listed.

Uploaded by

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

Data Structures Course Overview

This document outlines the course CSE228: Data Structures. The course aims to teach students how to analyze algorithm efficiency using asymptotic notations, illustrate the importance of queues in problem solving, differentiate between HashTables and HashMaps, identify appropriate data structures like HashSets and trees for problems, and analyze the effectiveness of priority queues and heaps. The course covers stacks, queues, hash tables, hash maps, hash sets, binary trees, binary search trees, priority queues, heaps, and graphs through both theory and practical sessions. Key textbooks and references are also listed.

Uploaded by

Pulkit Narsaria
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSE228:DATA STRUCTURES

L:3 T:0 P:2 Credits:4

Course Outcomes: Through this course students should be able to

CO1 :: describe the process to find efficiency of algorithms using asymptotic notations

CO2 :: illustrate the importance of Queue in context of problems solving

CO3 :: differentiate the HashTable and HashMap in context of writing efficient program

CO4 :: identify the appropriateness of HashSet and tree in problem solving

CO5 :: analyze the effectiveness of Priority queue and Heap Data Structures

CO6 :: use of Graph and various techniques in real world problem solving

Unit I
Introduction : Basic Data Structures, Basic Concepts and Notations, Complexity analysis: time space
and trade off, Omega Notation, Theta Notation, Big O notation
Stacks : Introduction to Stacks, Parenthesis matching problem using Stacks, Implementing a stack,
Industry demonstration: File versioning system
Unit II
Queues : Introduction to Queues, Ticket booking system using Queues, implement a stack using two
queues, implement a stack using one queue, Palindromic string problem, Duplicate parenthesis
problem, Reversing a stack problem, Kth largest element problem
Unit III
HashTables : Design and performance analysis of hash tables, Hash functions and hashing, Collision
in hash tables, how to check if a given hash function is good or bad, Implementation of a dictionary
(phone book) using a hash table
HashMaps : Introduction to the HashMaps, Find Symmetric Pairs problem, First Unique Character
problem
Unit IV
HashSets : Introduction to the HashSets, Array of Contiguous Integers problem, Pair with a Given
Sum problem, Itinerary From all Tickets problem, Match Locks and Keys problem
Binary Trees : Title problem: Runway Reservation, Linear vs non-Linear data structures, Trees &
Binary Trees, Properties, Types & Representation of binary trees, Tree Traversal: DFS & BFS,
Mirroring a tree problem, Spiral order traversal of a tree
Binary Search Trees : Introduction to the Binary Search Trees, Searching, Insertion & Deletion in a
BST, Lowest common ancestor problem, Balanced BSTs, Solution of the Title Problem
Unit V
Priority Queues : Introduction to the Priority queues with example, Priority queues ADT,
Implementation of priority queues using LinkedList and ArrayList
Heaps : Introduction to the Heaps, Basic operations performed on heaps, Sorting, Merge k sorted
linked list problem, Median of stream of integers problem
Unit VI
Graphs and Graph Algorithms : Depth-First Search, Breadth-First Search, Edge list, Adjacency
matrix, Adjacency list, Dijkstra’s algorithm, Application of graphs in real life

List of Practicals / Experiments:

Stacks and Queues


• Program to sort a stack using recursion

• Program to delete middle element of a stack

• Solving the parenthesis matching problem using stacks

• Program to implement operations in Queue:a. Reversing a Queue using recursionb. Check if a queue
can be sorted into another queue using a stack

Session 2022-23 Page:1/2


HashMap
• Program to find the length of the longest subarray with sum equal to zero.

• Program to find First unique character

Binary Trees and BSTs


• Program to check if a binary tree is BST or not.

• Program to Spiral level order traversal

Priority Queues and Heaps


• Program to convert a min heap to max heap.

• Implementation of a complete binary tree.

Graph and Graph Algorithm


• Program to check whether a directed graph contains a cycle or not.

• To Count the total number of ways or paths that exist between two vertices in a directed graph.

Text Books:
1. DATA STRUCTURES AND ALGORITHMS by ALFRED V. AHO, JEFFREY D. ULLMAN AND JOHN
E. HOPCROFT, PEARSON, PEARSON
References:
1. DATA STRUCTURES AND ALGORITHMS IN JAVA by MICHAEL T. GOODRICH AND ROBERTO
TAMASSIA, JOHN WILEY & SONS

Session 2022-23 Page:2/2

Common questions

Powered by AI

Priority queues leverage heaps as their underlying data structure to efficiently manage data with varying priority levels. Heaps—specifically binary heaps—allow quick access to the highest (or lowest) priority element, making insertions and deletions run in O(log n) time. This synergy enables priority queues to efficiently perform tasks such as scheduling and managing resource allocation, where priority-based processing is crucial. The heap structure maintains the minimum or maximum element at the root, ensuring optimal performance for priority-based operations .

Asymptotic notations are pivotal in analyzing algorithm efficiency by providing a means to describe the limiting behavior of an algorithm's run time or space requirements in terms of input size. Big O notation offers an upper bound on the time complexity, representing the worst-case scenario. Omega notation provides a lower bound, indicating the best-case run time. Theta notation defines an exact bound, encapsulating both upper and lower bounds for average cases. These notations allow systematic comparison of algorithm performances irrespective of machine- or implementation-specific factors .

HashSets are more appropriate in scenarios demanding fast lookups, inserts, and deletions without concern for order, operating in average O(1) time. They excel in cases like testing membership, managing unique keys, or storing distinct elements. In contrast, binary trees maintain element order, beneficial for sorted data tasks, providing O(log n) operations in balanced trees. However, HashSets lose efficiency in worst-case scenarios (hash collisions) and lack inherent order, whereas trees guarantee order preservation but can have slower operations if unbalanced .

Queues enhance problem-solving by structuring data access patterns that require sequential processing, like in scheduling and real-time systems. For example, in a ticket booking system, queues ensure a fair first-come, first-served approach. They enable efficient management of shared resources and concurrency constraints, as evident in networking tasks or printer job scheduling .

HashTable and HashMap differ mainly in synchronization and null handling. A HashTable is synchronized, meaning it is thread-safe but comes with performance overhead due to locking, while HashMap is non-synchronized, providing better performance in single-threaded environments. HashTable does not allow null keys or values, whereas HashMap permits one null key and multiple null values. These differences influence their efficiency based on use cases; HashMap is preferred in environments where thread safety is not a priority, benefiting from faster operation speeds .

Cycle detection in directed graphs can be achieved using Depth-First Search (DFS) or the Kahn's algorithm for topological sorting. The presence of back edges during DFS indicates a cycle. Kahn's algorithm utilizes in-degrees and identifies cycles if a node remains unprocessed. Cycle presence implies potential issues such as deadlocks or instability in systems modeled by the graph, influencing reachability and order of processes. It also complicates the application of algorithms that assume acyclic structures, such as certain scheduling or optimization tasks .

DFS (Depth-First Search) and BFS (Breadth-First Search) are pivotal in efficiently navigating and managing hierarchical data structures. DFS explores as far as possible along each branch before backtracking, which is useful for tasks like evaluating expressions in syntax trees or finding paths in mazes. BFS traverses level by level, providing the shortest path in unweighted graphs and is optimal for finding nearest neighbors. Both techniques facilitate diverse operations in trees, such as searching, sorting, and manipulating data .

Binary Search Trees (BSTs) allow efficient searching, insertion, and deletion operations, generally in O(log n) time; however, they may degrade to O(n) in worst-case scenarios if unbalanced. Balanced search trees, like AVL or Red-Black trees, maintain a self-balancing property, ensuring stricter O(log n) performance across operations by restructuring the tree after insertions or deletions. While balanced trees incur additional complexity in maintaining balance through operations (rotations), they consistently provide optimal performance regardless of data input patterns .

Implementing a stack using queues involves simulating LIFO behavior with FIFO operations, generally requiring two queues to mimic stack operations. The key operations (push, pop) need queue operations like enqueue and dequeue, resulting in overheads. For instance, maintaining LIFO order in push operations may require moving elements between queues. This implementation ensures proficient conceptual demonstrations of data structures but typically incurs increased time complexity, often leading to O(n) for push or pop operations compared to the usual O(1) for stack operations .

Hash functions critically determine hash table performance by minimizing collisions, ensuring even data distribution across buckets. A 'good' hash function yields a uniform distribution, avoids clustering, and is computationally efficient. It should minimize collision probabilities to uphold the expected time complexity of O(1) for search, insert, and delete operations. Evaluating a hash function's quality involves checking its output distribution for different inputs and ensuring performance consistency under varied workloads .

You might also like