Advanced Data Structure and Algorithms Question Bank
Advanced Data Structure and Algorithms Question Bank
QUESTION BANK
I - MCA
MC4101 - ADVANCED DATA STRUCTURES AND ALGORITHMS
QUESTION BANK
PART - A
1. Define Algorithm
An Algorithm is a set of well-defined instructions designed toper form a
specific set of tasks. Algorithms are used to perform calculations, automatic
reasoning, data processing, computations, and problem-solving.
8. Define Recursion
Recursion Tree Method is a pictorial representation of an iteration method
which is in the form of a tree where at each level nodes are expanded.
9. Explain O notation
The theta notation bounds a function from above and below, so it defines
exact asymptotic behavior. A simple way to get the Theta notation of an
expression is to drop low-order terms and ignore leading constants.
PART – B
1. Explain Asymptotic notations and list out common notations with an
example.
2. Explain Recursion Tree Method with an example.
3. Explain about Importance of efficient algorithms.
PART – C
1. Explain following :
i) Algorithm
ii) Time and Space Complexity
iii) Asymptotic Analysis
iv) Asymptotic Notations
UNIT – II HIERARCHICAL DATA STRUCTURE
PART - A
1. Write down the properties of Red Black Trees?
Red Black Trees having three types of properties. These are Rotations,
Insertion, and Deletion.
1) It’s a complete tree (All levels are completely filled except possibly the last
level and the last level has all keys as left as possible). This property of Binary
Heap makes them suitable to be stored in an array.
2) A Binary Heap is either Min Heap or Max Heap. In a Min Binary Heap, the key
at root must be minimum among all keys present in Binary Heap. The same
property must be recursively true for all nodes in Binary Tree. Max Binary Heap is
similar to MinHeap.
4. What is Root?
In a tree data structure, It is specially designed data item in a tree. It is the
first in the hierarchical arrange data items. Every tree must have root node. In
any tree, there must be only one root node. We never have multiple root
nodes in a tree.
5. What is Edge?
In a tree data structure, the connecting link between any two nodes is called
as EDGE. In a tree with 'N' number of nodes there will be a maximum of 'N-
1' number of edges
6. Define Parent.
In a tree data structure, the node which is predecessor of any node is called as
PARENT NODE. In simple words, the node which has branch from it to any
other node is called as parent node. Parent node can also be defined as "The
node which has child / children".
7. Define Child
In a tree data structure, the node which is descendant of any node is called as
CHILD Node. In simple words, the node which has a link from its parent
node is called as child node. In a tree, any parent node can have any number
of child nodes. In a tree, all the nodes except root are child nodes.
8. Define Siblings
In a tree data structure, nodes which belong to same Parent are called as
SIBLINGS. In simple words, the nodes with same parent are called as
Sibling nodes.
PART B
1. Explain various cases of deletion in binary search trees with an example for each .
2. Define B-Tree and explain the inserting and deletion operation of B tree with
pseudocode with example.
3. Explain Heap data structure and also explain about min heap and max heap with one
example of heap construction.
4. Explain the following
i) Binary Search Tree
ii) Red Black Trees.
iii) Rotations in BST
iv) Traversal in B-Tree
v) Applications of Heaps.
vi) Operations in Min heap
PART C
1. Explain the Following
i) Disjoint sets
ii) Properties of Intersection
iii) Fibonacci Heaps.
iv) Memory representation of the Nodes in a Fibonacci Heap
v) Operations on a Fibonacci Heap
vi) Bounding the maximum degree
UNIT – III GRAPHS
PART A
.
1. List out the steps in Floyd-Warshall algorithm
Initialize the distance matrix:
Create a matrix dist[][] where dist[i][j] holds the shortest distance
between vertex i and vertex j. Initially, set:
dist[i][j] = weight of edge (i, j) if there's an edge.
dist[i][j] = ∞ if no edge exists between i and j (except for diagonal
elements, dist[i][i] = 0).
Update the distance matrix:
For each vertex k, iterate through all pairs of vertices i and j, and
update the matrix as:
dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])dist[i][j] = \min(dist[i][j],
dist[i][k] + dist[k][j])dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])
Repeat this process for every intermediate vertex k.
6. What is Loop?
An edge of a graph which connects to itself is called a loop or sling.
PART – B
1. List out the steps in Kruskal’s algorithms and apply on the following graph to
construct minimum cost spanning tree. Show the step by step construction of the
tree.
2. Difference between DFS and BFS graph traversal algorithms. Consider a tree of
minimum height of 4, and do BFS and DFS traversals.
3. Write First Depth Algorithm and apply it on the following graph represented as
an adjacency matrix
2. Difference between Krushkal and prim’s Algorithms with suitable examples for
each.
3. Breify explain about the Floyd-Warshall Algorithm.
UNIT – IV ALGORITHM DESIGN AND ANALYSIS
1. Describe about Algorithm
The algorithm is defined as a collection of unambiguous instructions
occurring in some specific sequence and such an algorithm should produce output
for given set of input infinite amount of time.
5. Define Backtracking
Backtracking is a method in which the desired solution is expressed as n
tuple (x1,x2, x3….. x n)which is chosen from solution space, using
backtrack formulation. The solution obtained i.e. (x1, x2, x3….. x n)
can either minimizes or maximizes or satisfies the criteria function.
PART - C
1. Explain the following :
I. Elements, Components and Applications of Dynamic
Programming
II. LCS using Greedy Algorithm with example
III. Build Huffman Tree with example
UNIT – V NP COMPLETE AND NP HARD
PART A
1. Draw a diagram showing relationship between P,NP,NP hard and NP Complete
problems in advanced data structure and algorithms?
4. What is Reduction?
Let L1 and L2 be two decision problems. Suppose algorithm A2
solves L2. That is, if y is an input for L2 then algorithm A2 will answer
Yes or No depending upon whether y belongs to L2 or not. The idea
is to find a transformation from L1 to L2 so that algorithm A2 can be part of
an algorithm A1 to solve L1.
5. How to prove that a given problem is NP Complete?
From the definition of NP-complete, it appears impossible to
prove that a problem L is NP-Complete. By definition, it requires us to
that show every problem in NP in polynomial time reducible to L.
Fortunately, there is an alternate way to prove it. The idea is to take a
known NP-Complete problem and reduce it to L. If polynomial time
reduction is possible, we can prove that L is NP-Complete by
transitivity of reduction (If a NP-Complete problem is reducible to L in
polynomial time, then all problems are reducible to L in polynomial time).
Cook’s Theorem implies that any NP problem is at most polynomially harder than
SAT. This means that if we find a way of solving SAT in polynomial time, we will then
be in a position to solve any NP problem in polynomial time. This would have huge
practical repercussions, since many frequently encountered problems which are so far
believed to be intractable are NP. This special property of SAT is called NP-
completeness. A decision problem is NP-complete if it has the property that any
NP problem can be converted into it in polynomial time
PART B
1. Explain NP-Complete problem with an example.
2. Explain the Relationship between P,NP,NP-hard, NP-Complete.
3. What are the problems in NP and NP-hard?
4. Explain about Cook’s theorem.
PART C
1. Discuss in detail about NP-hard and NP –Complete problems.
2. Difference between NP, NP-hard and NP- Complete problems with suitable
exmaples.
PREVIOUS YEAR QUESTION PAPER:
https://www.binils.com/wp-content/uploads/2024/01/MC-4101-Advanced-Data-Structures-and-
Algorithms.pdf
https://www.studocu.com/in/document/anna-university/master-of-computer-
applications/mca-i-semester-previous-year-question-paper-regulation-2021/56696781
REFERENCE NOTES
https://www.studocu.com/in/document/anna-university/master-of-computer-
applications/mc4101-ads-notes-advance-data-structure-nodes/48728773