ADSA COURSEPACK Final Oct 24 2023
ADSA COURSEPACK Final Oct 24 2023
SCHEME
The scheme is an overview of work-integrated learning opportunities and gets students out into the real
world. This will show what a course entails.
Practical
Practical
Tutorial
0 0
Theory
delivery
study
Self-
SEE
Practical
CIE
1 2
Self-study 1 10
Total 5 15 45 0 30 150 50% 50%
Course Dr. Anupam Kumar Sharma Course Dr. Nabanita Mahata
Lead Coordinator
Names Theory Practical
Course Nabanita Mahata Nabanita Mahata
Instructors Vipul Narayan Vipul Narayan
Vijayant Pawar Vijayant Pawar
Biswa Mohan Sahoo Biswa Mohan Sahoo
Gopal Chandra Jana Gopal Chandra Jana
Alok Kumar Alok Kumar
Mohd. Arquam Mohd. Arquam
Abdul Mazid Abdul Mazid
Anupam Kumar Sharma Anupam Kumar Sharma
Aditya Kishore Saxena Aditya Kishore Saxena
Krishna Kant Agrawal Krishna Kant Agrawal
Gyanendra Kumar Gyanendra Kumar
Pragya Pragya
Shivani Goswami Shivani Goswami
Abdul Aleem Abdul Aleem
Ravi Kumar Ravi Kumar
Vimal Kumar Vimal Kumar
G. Sakthi G. Sakthi
Abhist Kumar Abhist Kumar
Vimal Kumar Vimal Kumar
Himanshu Verma Himanshu Verma
Pragya Pragya
Gyanendra Kumar Gyanendra Kumar
Biswa Mohan Sahoo Biswa Mohan Sahoo
Aditya Kishore Saxena Aditya Kishore Saxena
COURSEPACK | FORMAT
Abdul Mazid Abdul Mazid
Vijayant Pawar Vijayant Pawar
Vipul Narayan Vipul Narayan
Raghvendra Ajay Mishra Raghvendra Ajay Mishra
COURSE OVERVIEW
An advanced course in data structures and algorithms builds upon the foundational knowledge of
basic data structures and algorithms. It delves deeper into more complex data structures and
advanced algorithmic techniques. This course explores advanced data structures and algorithmic
techniques used in computer science and software development. It focuses on the design, analysis,
and implementation of data structures and algorithms for solving complex computational problems
efficiently.
PREREQUISITE COURSE
COURSE OBJECTIVE
This course aims to familiarize students with algorithmic design techniques of dynamic
programming, greedy programming, and backtracking as well as advanced data structures
AVL Tree, B+ tree, Quad-Tree, Octree, and Trie. They will be taught to compute time and space
complexities of algorithms, and also implement them.
COURSE OUTCOMES(COs)
After the completion of the course, the student will be able to:
CO No. Course
Outcomes
E2UC503.1 Implement Stack, Queue, and Binary Tree data structures using Array and Linked
Lists.
E2UC503.2 Analyze the time and space complexity of algorithms related to algorithm
paradigms of dynamic programming, greedy algorithms, and back tracking.
E2UC503.3 Implement AVL Tree, B+ tree, Quadtree, Octree, and Trie using linked data structure.
E2UC503.4 Develop programs for computational problems like shortest path, all pairs shortest
path, N queens’ problem, minimum spanning tree, longest common subsequence,
0/1 knapsack, choosing appropriate algorithmic techniques out of dynamic
programming, greedy algorithms, and backtracking.
E2UC503.5 Develop simple software applications using basic and advanced data structures
with dynamic programming, greedy algorithms, and backtracking.
COURSEPACK | FORMAT
BLOOM’S LEVEL OF THE COURSE OUTCOMES
Bloom's taxonomy is a set of hierarchical models used for the classification of educational learning
objectives into levels of complexity and specificity. The learning domains are cognitive, affective, and
psychomotor.
COMPREHENSIVE
PO2 Problem analysis: Identify, formulate, review research literature, and analyze complex
computing science problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and computer sciences.
PO3 Design/development of solutions: Design solutions for complex computing problems and
design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
PO5 Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
computing science and IT tools including prediction and modeling to complex computing
activities with an understanding of the limitations.
PO6 IT specialist and society: Apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to
the professional computing science and information science practice.
PO7 Environment and sustainability: Understand the impact of professional computing science
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
PO8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of computing science practice.
COURSEPACK | FORMAT
PO9 Individual and teamwork: Function effectively as an individual, and as a member or leader
in diverse teams, and in multidisciplinary settings.
PO11 Project management and finance: Demonstrate knowledge and understanding of the
computing science and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
PO12 Life-long learning: Recognize the need for and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.
PSO1: Have the ability to work with emerging technologies in computing requisite to Industry
4.0.
PSO2: Demonstrate Engineering Practice learned through industry internship and research
project tosolve live problems in various domains.
COURSE ARTICULATIONMATRIX
The Course articulation matrix indicates the correlation between Course Outcomes and Program
Outcomes and their expected strength of mapping in three levels (low, medium, and high).
PSO1
PSO2
PO10
PO11
PO12
PO1
PO2
PO3
PO4
PO5
PO6
PO7
PO8
PO9
COs#/
POs
E2UC 503.1 2 2
E2UC 503.2 2 2 2
E2UC 503.3 2 2 1 2
E2UC 503.4 2 2 2 2 1 1 1
E2UC 503.5 2 2 2 2 1 1 1 1 2
Note: 1-Low, 2-Medium, 3-High
COURSE ASSESSMENT
The course assessment patterns are the assessment tools used both in formative and summative
examinations.
COURSEPACK | FORMAT
Type of course CIE Total Marks
Final Marks
Lab@ MTE Course CIE SEE CIE*0.5+SEE*0.5
(Work based
+ project^
Record)
Comprehensive 25 50 25 100 100 100
COURSE CONTENT
THEORY+ PRACTICAL
Contents
Theory
Arrays: Definition, Single and Multidimensional Arrays, Representation of Arrays: Row Major
Order, and Column Major Order, Derivation of Index Formulae for 1-D, 2-D, 3-D, Sparse
Matrices and their representations.
Linked lists: Implementation of Singly Linked Lists. Operations on Linked List. Insertion,
Deletion, Traversal. QUEUES
Stacks: List Implementation of Stack, Application of stack: infix, Prefix and Postfix Expressions,
infix to postfix expression, Evaluation of postfix expression,
Recursion- Principles of recursion, Tail recursion, Removal of recursion Problem solving using
iteration and recursion with examples such as binary search, Tower of Hanoi.
Queues: Operations on Queue: Create, Add, Delete, Full & Empty,
Searching, Index Sequential Search, Concept of Hashing & Collision resolution Techniques
used in Hashing.
Tree: Linked List Representation, Binary Search Tree, Tree Traversal algorithms: In-order, Pre-
order, and Post-order, Constructing Binary Tree from given Tree Traversal, Operation of
Insertion, Deletion, Searching Modification of data in Binary Search. Concept & Basic
Operations for AVL Tree, B+ tree. Implementation of Quad-Tree and Octree
COURSEPACK | FORMAT
Graph: Representations: Adjacency Matrices, Adjacency List, Graph Traversal: Depth First
Search & Breadth First Search.
Minimum Cost Spanning Trees: Prims and Kruskal algorithm. Shortest Path algorithm:
Warshal Algorithm.
Dynamic Programming: Elements of dynamic programming, longest common subsequence,
Optimal binary search trees, 0/1 Knapsack.
Greedy Algorithms: Elements of the greedy strategy, Offline caching, Fractional knapsack
Back Tracking: Sum of subset, N queens’ problem
Bipartite Graphs: Maximum bipartite matching, The stable-marriage problem
Trie Data structure, Trie insert and search
Bitonic Sort and Radix sort
S.
Review Practicals
No.
1 Write a program to implement linked list, also implement add, delete nodes in a linked list.
2 Write a program to implement Stack operations using linked list implementation of Stack.
3. Write a program to implement Queue operations using linked list implementation.
List of Practicals
1 Write a program to implement Tower of Hanoi.
2 Write a program for to convert infix expression to postfix and evaluate it.
3 Write a program to implement Queue operations using linked list implementation.
4 Write a program to implement Binary Search Tree.
5 Write a program to traverse a binary tree using PRE-ORDER, IN-ORDER, POST-ORDER
traversal techniques.
6 Write a program to construct a binary tree using given tree traversal.
7 Write a program for B+ Tree
8 Write a program to implement AVL Tree.
9 Write a program to implement Quad Tree.
10 Write a program to implement Octree.
11 Write a program to traverse a graph using breadth-first search (BFS).
12 Write a program to traverse a graph using depth-first search (DFS).
13 Write a program for Kruskal’s algorithm for a given graph
14 Write a program for Prim’s algorithm for a given graph
15 Write a program for all pairs shortest path.
16 Write a program for 0/1 knapsack.
17 Write a program for fractional knapsack.
18 Write a program to implement Radix sort.
19 Write a program to insert and delete in Trie data structure.
COURSEPACK | FORMAT
Value Added Practicals
1 Write a program to implement N queens' problem.
2 Write a program for Longest Common Subsequence.
3 Write a program for sum of subsets problems.
COURSEPACK | FORMAT
Theory
Infix to postfix expression,
11
Evaluation of postfix expression
Practical Implement
19 Write a program to implement the concept
Queue operations using linked of indexed
list implementation. Find Practical sequential
20 complexity of program. search and
hashing.
COURSEPACK | FORMAT
Constructing Binary Tree from Theory
27
given Tree Traversal,
Concept & Basic Operations for Theory
28
AVL Tree
Write a program to traverse a Practical
29 binary tree using PRE-ORDER,
IN-ORDER, POST-ORDER Practical
30 traversal techniques. Find
complexity of program.
Theory Implement
31 Insertion in AVL trees AVL Tree,
Theory B+ tree,
32 Deletion in AVL trees Quadtree,
Octree, and
Implementation of Quad tree and Theory Trie using CO2, CO3.
33
Octree. linked data
Write a program to construct a Practical structure, and
34
binary tree using given tree will be able
traversal. Find complexity of Practical to find time
35 program. and space
complexity of
Introduction B+ tree, insertion Theory program.
36
and Deletion in B+ tree
Data Structure for Graph Theory
37 Representations: Adjacency
Matrices, Adjacency List,
Graph Traversal: Depth First Theory
38
Search, Breadth First Search Develop
39 Write a program for Practical program for
implementation of B+ Tree. Find Practical graph data
40
complexity of program. structure and
Graph Traversal: Breadth First Theory its traversal,
41
Search spanning tree
Spanning Trees, Minimum Cost Theory and CO2, CO4
42 Spanning Trees: Prim’s conversion of
algorithm graph to
43 Kruskal algorithm Theory MST.
Practical
44 Write a program to implement
AVL Tree. Find complexity of
Practical
45 program.
COURSEPACK | FORMAT
48 Longest common subsequence Theory
Write a program to implement Practical
49
Quad Tree.
Write a program to implement Practical Develop and
50
Octree. analyse
51 Optimal binary search trees (1) Theory dynamic
52 Optimal binary search trees (2) Theory programming
Theory program for
53 0/1 knapsack problem longest CO2, CO4
common
Write a program to traverse a Practical
subsequence,
graph using breadth-first search 0/1 knapsack,
54
(BFS). Find complexity of
program.
Write a program to traverse a Practical
graph using depth-first search
55
(DFS). Find complexity of
program.
56 Elements of the greedy strategy Theory
57 Offline caching Theory
58 Fractional knapsack Theory
Write a program for Kruskal’s Practical
59 algorithm for a given graph. Develop and
Find complexity of program. analyse greedy
Write a program for Prim’s Practical method,
60 algorithm for a given graph. backtracking,
Find complexity of program.
61 Back Tracking, Sum of subset Theory
62 N queens’ problem Theory CO2, CO4
Bipartite graph, maximum Theory
63
bipartite matching
Write a program for all pairs Practical
64 shortest path. Find complexity of
program.
Write a program for Longest Practical
65 Common Subsequence. Find Develop and
complexity of program. analyse
66 The stable-marriage problem Theory Bipartite
67 Trie Data structure Theory graph, Trie
data structure,
68 Trie insert and search Theory
Radix sort, and
Write a program for 0/1 Practical Bitonic sort
69
knapsack.
Write a program to implement N Practical
70 queens' problem. Find
complexity of program.
71 Trie delete Theory
COURSEPACK | FORMAT
72 Radix Sort Theory
73 Bitonic Sort Theory
Write a program to insert and Practical
74 delete in Trie data structure.
Find complexity of program.
Write a programs to implement Practical
75 Bitonic sort, radix sort. Find
complexity of programs.
76 Project Project Students will
77 Project Project be able to
develop small
78 Project Project software
79 Project Project application
Project Project based on CO5
dynamic
programming,
80
backtracking,
and greedy
algorithms.
BIBLIOGRAPHY
COURSEPACK | FORMAT
PRACTICE PROBLEMS
SNo Problem KL
1
Write a program in Java or Python and find time complexity for 2–Sum K3
Problem: Finding two numbers in an array that add up to a given target value.
Write a program in Java or Python and find time complexity for Longest K3
2 Common Subsequence Problem: Finding longest subsequence which is
common in all given input sequences.
Write a program in Java or Python and find time complexity for Maximum K3
3 Subarray Problem: Finding a contiguous subarray with the largest sum, within a
given one-dimensional array A[1...n] of numbers.
Write a program in Java or Python and find time complexity for Coin Change K3
Problem: Finding the number of ways to make sum by using different
4
denominations from an integer array of coins[ ] of size N representing different
types of denominations and an integer sum.
Write a program in Java or Python and find time complexity for 0–1 Knapsack K3
5
Problem: Restrict the number of copies of each kind of item to zero or one.
Write a program in Java or Python and find time complexity for Subset Sum K3
6 Problem: Checking if there is a subset of the given set whose sum is equal to
the given sum.
Write a program in Java or Python and find time complexity for Longest K3
7 Palindromic Subsequence Problem: Finding a maximum-length subsequence of
a given string that is also a Palindrome.
Write a program in Java or Python and find time complexity for Matrix Chain K3
Multiplication Problem: Finding the most efficient way to multiply these
8
matrices together such that the total number of element multiplications is
minimum.
Write a program in Java or Python and find time complexity for Longest K3
Common Substring Problem: A set of strings can be found by building a
9 generalized suffix tree for the strings, and then finding the deepest internal
nodes which have leaf nodes from all the strings in the subtree below it.
Write a program in Java or Python and find time complexity for Rod Cutting K3
Problem: A rod is given of length n. Another table is also provided, which
10 contains different size and price for each size. Determine the maximum price by
cutting the rod and selling them in the market.
Write a program in Java or Python and find time complexity for Word Break K3
Problem: You will be given a string, say "s", and a dictionary of strings say
11 "wordDict". You have to return true if s can be segmented into a space-
separated sequence of one or more dictionary words.
Write a program in Java or Python and find time complexity for Edit Distance K3
Problem: Quantifying how dissimilar two strings (e.g., words) are to one
12 another, that is measured by counting the minimum number of operations
required to transform one string into the other.
Write a program in Java or Python and find time complexity for Chess Knight K3
13 Problem: A knight starting at any square of the board and moving to the
remaining 63 squares without ever jumping to the same square more than once.
COURSEPACK | FORMAT
Write a program in Java or Python and find time complexity for Partition K3
14 Problem: A given set can be partitioned in such a way, that sum of each subset
is equal.
Write a program in Java or Python and find time complexity for 3–Partition K3
15 Problem: Deciding whether a given multiset of integers can be partitioned into
triplets that all have the same sum.
Write a program in Java or Python and find time complexity for Snake and K3
Ladder Problem: Write a function that returns the minimum number of
16
jumps to take top or destination position. You can assume the dice you
throw results in always favor of you means you can control the dice.
Write a program in Java or Python and find time complexity for Largest K3
17 Consecutive Subarray Problem: Finding out the largest sum of the consecutive
numbers of the array.
Write a program in Java or Python and find time complexity for Dutch National K3
Flag Problem: The flag of the Netherlands consists of three colors: white, red,
18
and blue. The task is to randomly arrange balls of white, red, and blue such that
balls of the same color are placed together.
Write a program in Java or Python and find time complexity for Knight’s Tour K3
19
Problem: a puzzle where a chess knight is placed on an empty chess board and
the goal is to move the knight to every square on the board exactly once without
re-visiting any squares.
Write a program in Java or Python and find time complexity for Maximum Sum K3
20 Submatrix Problem: A 2D array arr[][] of dimension N*M is given, the task is
to find the maximum sum sub-matrix from the matrix arr[][].
Write a program in Java or Python and find time complexity for Longest K3
21 Palindromic Substring Problem: Finding a maximum-length contiguous
substring of a given string that is also a palindrome.
Write a program in Java or Python and find time complexity for Job Sequencing K3
22 Problem: You have a single processor operating system and a set of jobs that
have to be completed with given deadline constraints.
Write a program in Java or Python and find time complexity for N–Queens K3
23 Problem: Placing N chess queens on an N×N chessboard so that no two queens
attack each other.
Write a program in Java or Python and find time complexity for Maximum K3
Product Subarray Problem: Find the contiguous subarray within the array which
24
has the largest product of its elements. You have to report this maximum
product.
Write a program in Java or Python and find time complexity for Longest K3
Repeated Subsequence Problem: Find the length of the longest repeating
25
subsequence in a given string such that the two subsequences don't have the
same original string character at the same position.
Write a program in Java or Python and find time complexity for 3–Sum K3
Problem: Given an array and a value, find if there is a triplet in array whose sum
26
is equal to the given value. If there is such a triplet present in array, then print
the triplet and return true. Else return false.
Write a program in Java or Python and find time complexity for Shortest K3
27
Common Super Sequence Problem: Given two strings X and Y of lengths m
COURSEPACK | FORMAT
and n respectively, find the length of the smallest string which has both, X and
Y as its sub-sequences.
Write a program in Java or Python and find time complexity for Longest K3
Alternating Subarray Problem: Given an array containing positive and negative
28
elements, find a subarray with alternating positive and negative elements, and in
which the subarray is as long as possible.
Write a program in Java or Python and find time complexity for 4–Sum K3
Problem: Given an array nums of n integers and an integer target, are there
29
elements a, b, c, and d in nums such that a + b + c + d = target we need to find
all unique quadruplets in the array which gives the sum of target.
Write a program in Java or Python and find time complexity for K–Partition K3
30 Problem: Partitioning an array of positive integers into k disjoint subsets that all
have an equal sum, and they completely cover the set.
Write a program in Java or Python and find time complexity for Minimum Sum K3
Partition Problem: Given a set of positive integers S, partition set S into two
31 subsets, S1 and S2, such that the difference between the sum of elements in S1
and S2 is minimized. The solution should return the minimum absolute
difference between the sum of elements of two partitions.
Write a program in Java or Python and find time complexity for Wildcard K3
Pattern Matching Problem: We have a string and a pattern then we have to
32
compare the string with a pattern that whether the pattern matches with a string
or not
Write a program in Java or Python and find time complexity for Maximum K3
33 Overlapping Intervals Problem: Print the maximum number of overlap among
these intervals at any time.
Write a program in Java or Python and find time complexity for Graph Coloring K3
34 Problem: Assigning colors to the vertices such that no two adjacent vertexes
have the same color.
Write a program in Java or Python and find time complexity for Longest K3
35 Increasing Subsequence Problem: Given an array arr[] of size N, the task is to
find the length of the Longest Increasing Subsequence (LIS).
Write a program in Java or Python and find time complexity for Pots of Gold K3
Game Problem: Two players X and Y are playing a game in which there are pots
of gold arranged in a line, each containing some gold coins. They get alternating
turns in which the player can pick a pot from one of the ends of the line. The
36 winner is the player who has a higher number of coins at the end. The objective
is to maximize the number of coins collected by X, assuming Y also plays
optimally. Return the maximum coins X could get while playing the game.
Initially, X starts the game.
Write a program in Java or Python and find time complexity for Activity K3
37 Selection Problem: Selection of non-conflicting activities that needs to be
executed by a single person or machine in a given time frame.
Write a program in Java or Python and find time complexity for Longest K3
38
Alternating Subsequence Problem:One wants to find a subsequence of a given
sequence in which the elements are in alternating order, and in which the
sequence is as long as possible.
COURSEPACK | FORMAT
Write a program in Java or Python and find time complexity for Longest K3
Consecutive Subsequence Problem: First sort the array and find the longest
39 subarray with consecutive elements. After sorting the array and removing the
multiple occurrences of elements, run a loop and keep a count and max (both
initially zero).
Write a program in Java or Python and find time complexity for Weighted K3
40 Interval Scheduling Problem: A value is assigned to each executed task and the
goal is to maximize the total value. The solution need not be unique.
Write a program in Java or Python and find time complexity for Longest K3
Bitonic Subarray Problem: Find a subarray of a given sequence in which the
41
subarray’s elements are first sorted in increasing order, then in decreasing order,
and the subarray is as long as possible.
Write a program in Java or Python and find time complexity for Water Jugs K3
Problem: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump
42 which has unlimited water which you can use to fill the jug, and the ground on
which water may be poured. Neither jug has any measuring markings on it.
How can you get exactly 2 gallons of water in the 4-gallon jug?
Write a program in Java or Python and find time complexity for Hat Check K3
43 Problem: Given a positive number n, find the total number of ways in which n
hats can be returned to n people such that no hat makes it back to its owner.
Write a program in Java or Python and find time complexity for Merging K3
44 Overlapping Intervals: Start from the first interval and compare it with all other
intervals for overlapping.
Write a program in Java or Python and find time complexity for Longest K3
45 Common Prefix (LCP) Problem: An array of strings is the common prefix
between 2 most dissimilar strings.
Self-Learning (it’s a typical course-based project to be carried out by a whole class in groups of four
students each; they should exhibit higher level KLs)
The students, in a group, are expected to conceive an idea based on the content (objectives/outcomes) and
apply suitable knowledge to demonstrate their learning.
COURSEPACK | FORMAT
A) COURSE-BASED PROJECT (Psychomotor skills)
To enhance their skill set in the integrated course, the students are advised to execute course based.
design projects. Some sample projects are given below:
SNo Suggested KL
Projects
1 Develop a software for Snake Game K6
COURSEPACK | FORMAT
4. "Mastering Data Structures & Algorithms using C and C++" on
Udemy: Another comprehensive course that covers data structures and
algorithms with a focus on C and C++ programming languages.
5. "Data Structures and Algorithms in C++" by Coding Blocks on
YouTube: This is a free YouTube series that covers data structures and
algorithms in C++.
COURSEPACK | FORMAT