Gtu Algo Pyq
Gtu Algo Pyq
Introduction
● Purpose: This document serves as a comprehensive, topic-wise question
bank for the Gujarat Technological University (GTU) course "Analysis and
Design of Algorithms" (Subject Code: 3150703). It compiles questions from
past examinations held between Summer 2022 and Winter 2024, aiming to
assist students in their focused and effective preparation for this subject.
● Methodology: Questions have been meticulously extracted from official GTU
question papers. Each question has been carefully mapped to the relevant
chapters and topics as outlined in the official syllabus for the course. This
systematic organization allows for a structured approach to studying past
examination trends.
● Format Explanation:
○ Questions are presented under their respective chapter and topic
headings.
○ Each entry includes the original question number (e.g., Q.1 (a)), the full
question text, and the specific examination session (e.g., Winter 2023)
along with the marks allocated for that question (e.g., 3M).
○ Alternative questions, often denoted with an "OR" in the question
paper, are listed as distinct entries under the relevant topic.
○ Repetition Tracking: A significant feature of this compilation is the
tracking of repeated questions. If a question, or a very close variant
testing the same core concept, has appeared in multiple examinations,
this is indicated with a note in the format: ``. The question is listed once
under its primary topic, and all its recurrences are noted alongside its
first identified appearance in this compilation. This helps in identifying
frequently emphasized concepts.
○ Diagrams/Tables: If a question originally included a diagram that
cannot be reproduced here, it is tagged as [diagram exists]. Similarly, if a
question involved a table, the table content is transcribed if it is simple
and textual; for complex or graphical tables, a tag [table exists in question]
is used.
● How to Use This Document: Students are encouraged to use this document
to:
○ Understand the typical question patterns and types (definitional,
analytical, problem-solving) associated with each syllabus topic.
○ Identify questions and topics that have been frequently asked in past
examinations.
○ Gauge the mark distribution for different types of questions and topics.
○ Practice answering actual past examination questions to enhance
problem-solving skills and exam preparedness.
● Source Documents:
○ Syllabus: GUJARAT TECHNOLOGICAL UNIVERSITY Bachelor of
Engineering Subject Code: 3150703 ANALYSIS AND DESIGN OF
ALGORITHMS Semester V.
○ Question Papers:
■ BE - SEMESTER-V (NEW) EXAMINATION - WINTER 2022,
1
Subject Code: 3150703, Date: 09-01-2023.
■ BE - SEMESTER-V(NEW) EXAMINATION - SUMMER 2022,
Subject Code: 3150703, Date: 07/06/2022.
■ BE - SEMESTER- V EXAMINATION-SUMMER 2023, Subject
1
Code: 3150703, Date: 03/07/2023.
■ BE-SEMESTER-V (NEW) EXAMINATION - WINTER 2023,
Subject Code:3150703, Date: 20-12-2023.
■ BE - SEMESTER-V (NEW) EXAMINATION - SUMMER 2024,
1
Subject Code:3150703, Date:31-05-2024.
■ BE- SEMESTER-V (NEW) EXAMINATION - WINTER 2024,
1
Subject Code:3150703, Date:17-12-2024.
This foundational chapter, despite its minimal weightage in the overall scheme,
introduces the core concept of an algorithm and the basic mathematical tools
required for algorithm analysis. Questions from this chapter are typically definitional,
carrying lower marks (usually 3-4 marks), and aim to assess a student's grasp of
fundamental terminology. While direct questions may be few, the concepts learned
here are prerequisites for understanding more complex topics in subsequent
chapters.
● Topic: What is an algorithm?
○ Q.1 (a) Define the following terms: i) Function in mathematics ii) Linear
1
inequalities (Winter 2024, 3M)
■ Note: Part (ii) of this question pertains to the topic "Linear
Inequalities and Linear Equations."
● Topic: Vectors and Matrices
○ Q.1 (a) Define the following terms: i) Function in mathematics ii) Linear
1
inequalities (Winter 2024, 3M)
■ Note: Part (ii) directly addresses this topic.
■ The appearance of such questions indicates that basic
mathematical definitions outlined in the syllabus can be directly
examined.
○ Q.1 (b) Explain: Worst Case, Best Case and Average Case Complexity
with suitable example. (Summer 2022, 4M)
○ Q.1 (c) Explain the bubble sort algorithm and derive its best case,
1
worst case, and average case time complexity. (Summer 2023, 7M)
○ Q.1 (c) Write an algorithm for insertion sort. Calculate the best,
1
average and worst case complexity of it. (Winter 2024, 7M)
■ The ability to define, differentiate, and derive these complexity
cases for standard algorithms, especially basic sorting
algorithms, is a frequently assessed skill, often carrying
significant marks (4-7M).
● Topic: Amortized analysis
○ Q.1 (b) Explain the need of amortized notation. Explain with suitable
1
example. (Winter 2024, 4M)
■ Amortized analysis is a more specialized analysis technique.
Questions typically focus on its purpose (the "need") and require
an illustrative example (e.g., dynamic arrays/tables or the
aggregate method).
● Topic: Asymptotic Notations (Big O, Big Omega, Big Theta)
○ Q.1 (a) Define following terms: (i) Big O Notation, (ii) Big Theta
1
Notation, (iii) Big Omega Notation. (Summer 2023, 3M)
○ Q.2 (b) What is asymptotic notation? Find out big-oh notation of the
f(n)=3n2+5n+10 (Winter 2023, 4M)
○ Q.1 (c) Explain asymptotic analysis with all the notations and its
1
mathematical inequalities. (Winter 2022, 7M)
○ Q.1 (b) Define Big-oh and Theta notations with graph (Summer 2024,
1
4M) [graph exists]
○ Q.1 (a) Find Omega ( ) notation of function f(n)=2n2+n∗lg n+6n
1
(Summer 2024, 3M)
○ Q.1 (b) State whether the statements are correct or incorrect with
reasons. 1. O(f(n))+O(f(n))=O(2f(n)) 2. If 3n+5=O(n2), then 3n+5=o(n2)
1
(Winter 2022, 4M)
■ Asymptotic notations are a cornerstone of algorithm analysis
and are consistently and heavily tested, often appearing in initial
questions (Q.1). Questions span a range from basic definitions
to applying notations to mathematical functions, explaining them
with graphical representations, and understanding their formal
mathematical properties and relationships (e.g., Big O vs. little
o). Mastery of these notations, including their definitions,
calculations, and conceptual distinctions, is critical.
● Topic: Analyzing control statement
○ Q.2 (a) What is the use of Loop Invariant? What should be shown to
1
prove that an algorithm is correct? (Winter 2022, 3M)
■ Loop invariants provide a formal method for proving algorithm
correctness. Questions on this topic are typically theoretical,
focusing on the definition, purpose, and the three essential
properties (initialization, maintenance, termination) that must be
demonstrated.
● Topic: Sorting Algorithms and analysis (Bubble sort, Selection sort,
Insertion sort, Shell sort, Heap sort)
○ Bubble Sort:
■ Q.1 (c) Explain the bubble sort algorithm and derive its best
case, worst case, and average case time complexity. (Summer
1
2023, 7M)
○ Selection Sort:
■ Q.1 (c) Write selection sort algorithm and compute running time
of algorithm. (Winter 2023, 7M)
■ Q.2 (a) Write an algorithm of Selection Sort Method. (Summer
2022, 3M)
○ Insertion Sort:
■ Q.1 (c) Write and analyze an insertion sort algorithm to sort n
items into ascending order. (Summer 2024, 7M) [1 time
repeated in Winter 2024, Q.1 (c) Write an algorithm for insertion
sort. Calculate the best, average and worst case complexity of
1
it., 7M]
○ Heap Sort:
■ Q.2 (c) OR Give the properties of Heap Tree. Sort the following
data using Heap Sort Method: 20, 50, 30, 75, 90, 60, 80, 25, 10,
40. (Winter 2023, 7M) [diagram exists] (Implied for heap
construction and sorting steps)
○ General Sorting Comparison:
■ Q.1 (a) Sort the best case running times of all these algorithms
in a non-decreasing order. LCS, Quick-Sort, Merge-Sort,
Counting-Sort, Heap-Sort, Selection-Sort, Insertion-Sort,
1
Bucket-Sort, Strassen's Algorithm. (Winter 2022, 3M)
■ The fundamental quadratic sorting algorithms (Bubble,
Selection, Insertion) are common examination topics, typically
requiring students to write the algorithm pseudocode and
perform a detailed complexity analysis (best, worst, and average
cases). Heap sort, an efficient O(nlogn) algorithm, is also tested,
often involving its application to a given dataset and
understanding heap properties. Comparative questions
assessing knowledge of complexities across multiple algorithms
also appear. Shell sort, though part of the syllabus , was not
featured in the analyzed examination papers.
● Topic: Sorting in linear time (Bucket sort, Radix sort, Counting sort)
○ Bucket Sort:
■ Q.1 (b) Perform Bucket sort for following sequence: 30, 12, 22,
1
66, 48, 27, 35, 43, 47, 41. (Summer 2023, 4M)
■ Q.2 (b) Sort the following elements using bucket sort. 10, 21, 29,
1
41, 52 (Winter 2024, 4M)
○ Counting Sort:
■ Q.3 (a) OR Apply counting sort for the following numbers to sort
in ascending order. 3, 1, 2, 3, 3, 1 (Winter 2023, 3M)
■ Q.2 (a) Sort the following elements using counting sort. 2.5, 3, 0,
1
2, 3, 0, 3 (Winter 2024, 3M)
■ Note: The Winter 2024 question for counting sort includes
non-integer data (2.5). Standard counting sort is designed
for integers. This might imply a variation, a need for data
transformation, or an assumption about handling such
inputs.
■ Linear time sorting algorithms like Bucket Sort and Counting
Sort are typically examined through application-based questions
where students must sort a given dataset. These questions
usually carry 3-4 marks. Radix sort, while included in the
syllabus , did not appear in the specific set of question papers
analyzed for this compilation.
○ Q.3 (b) Write an algorithm for Max-Min problem using divide and
1
conquer approach. Calculate its complexity. (Winter 2024, 4M)
■ While direct definitional questions like "Define Divide and
Conquer" are infrequent, a thorough understanding of the three
core steps (Divide, Conquer, Combine) is essential. This
understanding is implicitly tested when explaining specific D&C
algorithms (like Merge Sort or Quick Sort) or when asked to
design a D&C solution for problems like the Max-Min problem.
● Topic: Recurrence and different methods to solve recurrence (Master
Theorem, Substitution, Recursion Tree)
○ Master Theorem:
■ Q.1 (b) Solve the following using Master's theorem: a.
T(n)=2T(n/4)+1 b. T(n)=3T(n/4)+nlgn (Winter 2023, 4M)
■ Q.2 (b) Solve following recurrence using Master Theorem:
1
T(n)=3T(n/3)+n∧3. (Summer 2024, 4M)
■ Q.2 (c) Write the Master theorem. Solve following recurrence
using it. (i) T(n)=3T(n/2)+n2 (ii) T(n)=2T(n/2)+n log n (Winter
1
2024, 7M)
○ Substitution Method:
■ Q.2 (b) What is a recurrence? Solve recurrence equation for
1
T(n)=T(n−1)+1 using substitution method. (Summer 2023, 4M)
○ Recursion Tree Method:
■ Q.2 (c) OR What is recurrence? Explain recursion-tree method
1
with suitable example. (Summer 2024, 7M)
■ Q.2 (c) OR Perform the analysis of a recurrence relation
T(n)=2T(2n)+θ(n2) by drawing its recurrence tree. (Winter 2022,
1
7M) [diagram exists] (Implied for tree drawing)
○ Iterative Method (similar to Substitution/Unrolling):
■ Q.2 (c) OR Solve following recurrence relation using iterative
method T(n)=T(n−1)+1 with T(0)=0 as initial condition. Also find
big oh notation (Summer 2022, 7M)
○ General Recurrence Questions:
■ Q.2 (c) Write and explain the recurrence relation of Merge Sort.
1
(Winter 2022, 7M)
■ The ability to solve recurrence relations is a frequently tested
skill, with the Master Theorem being a particularly popular
choice for examiners. Questions vary from directly providing
recurrences for solution to asking students to state the theorem
and then apply it. Other methods like substitution and
recursion-tree are also part of the examination scope. A
fundamental understanding of what a recurrence relation
represents is also expected. The marks for these questions
(ranging from 4M to 7M) underscore the importance of both
procedural application and conceptual understanding of these
solution techniques.
● Topic: Multiplying large Integers Problem
○ Q.2 (c) Discuss Binary search algorithm, also write and solve its
1
recurrence relation. (Summer 2023, 7M)
○ Q.5 (a) Demonstrate Binary Search method to search Key=14, form the
1
array A =<2,4,7,8,10,13,14,60>. (Winter 2023, 3M)
○ Q.3 (a) OR Consider an array of size 2048 elements sorted in
non-decreasing order. Show how the Binary Search will perform on this
size by analysis of its recurrence relation. Derive the running time.
1
(Winter 2022, 3M)
○ Q.2 (c) OR Write binary search algorithm using recursion. Derive its
recurrence relation. Calculate its complexity using master theorem.
1
(Winter 2024, 7M)
■ Binary search is a quintessential D&C algorithm and is
frequently examined. Questions cover various aspects including
writing the algorithm, deriving and solving its recurrence relation,
analyzing its complexity, and demonstrating its application on a
given dataset. The repetition of the demonstration-type question
highlights its practical importance.
● Topic: Problem Solving using divide and conquer algorithm: Max-Min
problem
○ Q.3 (b) Write an algorithm for Max-Min problem using divide and
1
conquer approach. Calculate its complexity. (Winter 2024, 4M)
■ This is a standard application of the D&C strategy, testing the
student's ability to formulate a D&C solution for a given problem
and analyze its efficiency.
● Topic: Problem Solving using divide and conquer algorithm: Sorting
(Merge Sort, Quick Sort)
○ Merge Sort:
■ Q.3 (a) Sort the List "G,U,J,A,R,A,T,S,A,R,K,A,R" in alphabetical
order using merge sort. (Winter 2023, 3M) [diagram exists]
(Implied for merge steps)
■ Q.2 (c) OR Explain Merge Sort algorithm with suitable example.
1
(Summer 2023, 7M)
■ Q.2 (c) Write and explain the recurrence relation of Merge Sort.
1
(Winter 2022, 7M)
○ Quick Sort:
■ Q.2 (c) Illustrate the working of the quick sort on input instance:
25, 29, 30, 35, 42, 47, 50, 52, 60. Comment on the nature of
input i.e. best case, average case or worst case. Also discuss
1
worst and best case of quick sort algorithm. (Winter 2023, 7M)
■ Q.1 (c) Sort the following list using quick sort algorithm:< 5,
3,8,1,4,6,2,7 > Also write Worst and Best case and Average
case of quick sort algorithm. (Summer 2022, 7M)
■ Q.3 (a) Consider the array 2,4,6,7,8,9,10,12,14,15,17,19,20.
Show (without actually sorting), how the quick sort performance
1
will be affected with such input. (Winter 2022, 3M)
■ Merge Sort and Quick Sort are flagship D&C sorting algorithms
and are central to this chapter. Examination questions frequently
involve explaining the algorithms, applying them step-by-step to
given data, analyzing their recurrence relations and
complexities, and discussing their performance characteristics
under different input scenarios (especially for Quick Sort, due to
its sensitivity to pivot selection and input order). The high marks
often associated with these questions (typically 7M) signify their
importance. The recurrence of the Quick Sort illustration
question with specific data points towards a common problem
type.
● Topic: Problem Solving using divide and conquer algorithm: Matrix
Multiplication (Strassen's)
○ Q.3 (b) OR Write an algorithm for matrix multiplication using divide and
1
conquer approach. Calculate its complexity. (Winter 2024, 4M)
■ This question likely refers to Strassen's algorithm or a general
D&C approach to matrix multiplication.
○ Q.1 (a) Sort the best case running times of all these algorithms in a
non-decreasing order. LCS, Quick-Sort, Merge-Sort, Counting-Sort,
Heap-Sort, Selection-Sort, Insertion-Sort, Bucket-Sort, Strassen's
1
Algorithm. (Winter 2022, 3M) (Mentioned as part of a list for
complexity comparison)
■ Matrix multiplication using the D&C approach, exemplified by
Strassen's algorithm, is a known application. Questions may ask
for the algorithm's description or its complexity analysis. Its
inclusion in comparative complexity questions implies an
expectation that students are aware of its efficiency.
● Topic: Problem Solving using divide and conquer algorithm: Exponential
○ Q.4 (a) Explain Tower of Hanoi Problem, Derive its recursion equation
1
and computer it's time complexity. (Summer 2024, 3M)
■ The term "Exponential" in the syllabus under D&C likely refers to
problems whose D&C or recursive solutions lead to exponential
time complexities if not carefully designed, or classic recursive
problems like the Tower of Hanoi. The Tower of Hanoi is a
standard example used to illustrate recursion, and its analysis
reveals an exponential time complexity.
○ Q.3 (c) Given the denominations: d1=1, d2=4, d3=6. Calculate for
making change of Rs. 8 using dynamic programming. (Summer 2023,
1
7M)
○ Q.4 (b) Given coins of denominations 2, 3 and 4 with amount to be pay
is 5. Find optimal no. of coins and sequence of coins used to pay given
amount using dynamic method. (Winter 2023, 4M)
■ The coin change problem is a classic DP application, requiring
students to determine the minimum number of coins for a given
amount.
● Topic: Problem Solving using Dynamic Programming: Assembly
Line-Scheduling
○ Q.5 (c) Find all pair of shortest path using Floyd's Algorithm for
1
following graph. (Summer 2024, 7M) [diagram exists]
■ The Floyd-Warshall algorithm for finding all-pairs shortest paths
is a key DP application in graph problems.
● Topic: Problem Solving using Dynamic Programming: Matrix chain
multiplication
○ Q.3 (c) Using algorithm find an optimal parenthesization of a matrix
chain product whose sequence of dimension is (5,10,3,12,5,50,6) (use
dynamic programming). (Winter 2023, 7M)
○ Q.3 (c) The matrices A(5X10), B(10X15), C(15×20), and D(20×25) are
given. Solve the matrix chain multiplication problem using dynamic
1
programming. (Winter 2024, 7M)
○ Q.4 (a) Given is the S-table after running Chain Matrix Multiplication
algorithm. Calculate the parenthesized output based on
PRINT_OPTIMAL_PARENTHESIS algorithm. Assume the matrix are
names from A1, A2,....,An(Winter 2022, 3M) [table exists in question]
4 1 3 1
2 2 1
3 3
1
○
1
○
■ Matrix Chain Multiplication is a classic DP problem focusing on
finding the optimal order of multiplications. Questions may
involve solving the problem from scratch or interpreting results
from intermediate tables (like the S-table).
● Topic: Problem Solving using Dynamic Programming: Longest Common
Subsequence (LCS)
1
○
● Topic: Problem solving using Greedy Algorithm: Elements of Greedy
Strategy
○ Q.3 (a) OR Explain the steps of greedy strategy for solving a problem
1
(Summer 2024, 3M)
■ Questions directly ask for an explanation of the general steps or
components involved in designing a greedy algorithm.
● Topic: Problem solving using Greedy Algorithm: Minimum Spanning
trees (Kruskal's algorithm, Prim's algorithm)
○ Kruskal's Algorithm:
■ Q.4 (b) OR Write the Kruskal's Algorithm to find out Minimum
Spanning Tree. Apply the same and find MST for the graph
1
given below. (Winter 2023, 4M) [diagram exists]
■ Graph for Winter 2023 Q.4(b)OR and Summer 2022
Q.4(b)OR: Vertices 1-7, edges (1,2,28), (1,6,10), (2,3,14),
(2,7,16), (3,4,12), (4,7,18), (4,5,22), (5,7,24), (5,6,25).
■ Q.4 (c) OR Draw the minimum spanning tree correspond to
following graph using Kruskal's algorithm and find weight of
MST: (Summer 2023, 7M) [diagram exists]
■ Graph for Summer 2023 Q.4(c)OR: Vertices a-i, edges
(a,b,4), (a,h,8), (b,c,8), (b,h,11), (c,d,7), (c,f,4), (c,i,2),
1
(d,e,9), (d,f,14), (e,f,10), (f,g,2), (g,h,1), (g,i,6), (h,i,7).
■ Q.3 (c) Apply Kruskal's algorithm on the given graph and step by
step generate the MST. (Winter 2022, 7M) [diagram exists] (Graph
1
G(V,E) FIG:1)
■ Graph for Winter 2022 Q.3(c) (FIG:1): Vertices A-H,
edges (A,B,1), (A,D,4), (A,E,3), (B,C,2), (B,E,5), (C,F,11),
(D,E,2), (D,G,9), (E,F,10), (E,H,8), (F,H,7), (G,H,12).
○ Prim's Algorithm:
■ Q.4 (c) Draw the minimum spanning tree correspond to following
graph using Prim's algorithm and find the MST weight: (Summer
2023, 7M) [diagram exists]
■ Graph for Summer 2023 Q.4(c): Vertices 0-6, edges
(0,1,28), (0,5,10), (1,2,14), (1,6,16), (2,3,12), (3,4,22),
1
(3,6,18), (4,5,25), (4,6,24).
■ Q.3 (c) OR What is a minimum spanning tree? Draw the
minimum spanning tree correspond to following graph using
Prim's algorithm. (Summer 2024, 7M) [diagram exists]
■ Graph for Summer 2024 Q.3(c)OR: Vertices 1-7, edges
(1,2,5), (1,4,1), (1,5,3), (2,3,2), (2,4,9), (3,4,8), (3,6,4),
1
(3,7,7), (4,5,3), (5,6,6), (6,7,2).
■ Q.4 (c) Define minimum spanning tree. Explain Prim's algorithm
1
with suitable example. (Winter 2024, 7M)
■ Q.3 (c) OR Apply Prim's algorithm on the given graph in Q.3 (C)
FIG:1 Graph G(V,E) and step by step generate the MST. (Winter
1
2022, 7M) [diagram exists] (Refers to FIG:1 from Q.3(c))
■ Q.4 (b) Find Minimum Spanning Tree for the given graph using
Prim's Algorithm. (Summer 2022, 4M) [diagram exists]
■ Graph for Summer 2022 Q.4(b): Vertices a-f, edges
(a,b,1), (a,d,5), (a,e,13), (b,c,3), (b,d,4), (c,d,2), (c,f,5),
(d,e,8), (d,f,15).
○ Comparison/Definition:
■ Q.4 (a) OR Differentiate between Kruskal's algorithm and Prim's
1
algorithm for finding MST. (Summer 2023, 3M)
■ MST algorithms, specifically Prim's and Kruskal's, are very
frequently tested. Questions typically provide a graph and
require students to find the MST using one of these algorithms,
often asking to show the steps involved and the final MST
weight. Definitional questions about MSTs and comparisons
between the two algorithms also occur.
● Topic: Problem solving using Greedy Algorithm: Graphs: Shortest paths
(Dijkstra's - though not explicitly named here, it's the common greedy
for SSSP)
○ Q.5 (b) Solve the following knapsack problem using greedy method.
Number of items = 5, knapsack capacity W=100, weight vector
1
={50,40,30,20,10} and profit vector={1,2,3,4,5} (Winter 2023, 4M)
○ Q.3 (c) OR Consider Knapsack capacity W=15. w=(4,5,6,3) and
v=(10,15,12,8) find the maximum profit using greedy method. (Summer
2022, 7M)
○ Q.4 (c) OR "A greedy strategy will work for fractional Knapsack
problem but not for 0/1′′, is this true or false? Explain with suitable
example. (Winter 2024, 7M) [1 time repeated in Winter 2022 Q.3(b) "A
greedy strategy will work for fractional Knapsack problem but not for
1
0/1′′, is this true or false? Explain., 4M]
○ Q.4 (c) OR Explain fractional knapsack problem with example.
(Summer 2022, 7M)
■ The fractional knapsack problem is a classic application of the
greedy method. Questions involve applying the greedy strategy
(typically by selecting items with the highest profit/weight ratio)
to a given set of items and capacity. A critical concept often
tested is the distinction between why greedy works for fractional
knapsack but not for the 0/1 knapsack problem.
● Topic: Problem solving using Greedy Algorithm: Job Scheduling
Problem
○ Q.3 (b) Following are the details of various jobs to be scheduled on
multiple processors such that no two processes execute at the same
on the same processor. Show schedule of these jobs on minimum
number of processors using greedy approach. (Winter 2023, 4M) [table
exists in question]
* Q.4 (b) Using greedy algorithm find an optimal schedule for following jobs with <span
class="math-inline">n\=7</span> profits: (P1, P2, P3, P4, P5, P6, <span
class="math-inline">P7\)\=\(3,5,18,20,6,1,38\)</span> and deadline (d1, d2, <span
class="math-inline">d3,d4,d5,d6,d7\)\=\(1,3,3,4,1,2,1\)</span> (Summer 2024, 4M) [1]
* Job scheduling problems, often involving deadlines and profits, or minimizing processors,
are standard greedy algorithm applications.
○ Q.4 (b) Explain depth first traversal using suitable example. (Summer
1
2023, 4M)
1
○ Q.4 (a) Explain DFS with suitable example. (Winter 2024, 3M)
○ Q.5 (a) OR Define BFS. How it is differ from DFS. (Summer 2024, 3M)
1
○ Q.5 (b) OR Traverse the following graph using Breadth First Search
Technique. Also draw BFS Tree for a given graph. (Winter 2023, 4M)
[diagram exists]
■ Graph for Winter 2023 Q.5(b)OR: Vertices R, S, T, U, V, W, X, Y
with edges forming a connected component.
○ Q.4 (c) Explain Breath First Traversal Method for Graph with algorithm
with example. (Summer 2022, 7M)
1
○ Q.4 (a) OR Explain BFS with suitable example. (Winter 2024, 3M)
○ Q.5 (a) OR Define BFS. How it is differ from DFS. (Summer 2024, 3M)
1
■ Similar to DFS, BFS is tested through explanation, application to
a given graph (including drawing the BFS tree), and comparison
with DFS.
● Topic: Topological sort
○ Q.4 (c) Apply the algorithm to find strongly connected components from
the given graph. (Winter 2022, 7M) [diagram exists]
■ Graph for Winter 2022 Q.4(c): Graph with nodes A, B, C, D, E,
1
F, G, H.
■ While the syllabus mentions "Connected components" (typically
for undirected graphs), this question asks for "Strongly
Connected Components" (for directed graphs), which is a more
advanced application often solved using algorithms based on
DFS (like Kosaraju's or Tarjan's).
● Topic: Articulation Points (Cut Vertices)
Backtracking and Branch and Bound are techniques used for solving complex
optimization and search problems, often combinatorial in nature. The N-Queens
problem is a classic example frequently used to illustrate backtracking. Questions
may also cover definitions and comparisons of these two techniques, and
occasionally the Minimax principle.
● Topic: Introduction to Backtracking and Branch and Bound
○ (While Knapsack is listed here, specific questions asking for its solution
using Backtracking or Branch and Bound were not prominent in the
analyzed papers. DP and Greedy approaches for Knapsack were more
common in their respective chapters.)
● Topic: Travelling Salesman problem (using Backtracking/Branch and
Bound)
○ Q.4 (b) OR Explain the Minimax principle and show its working for
1
simple tic-tac-toe game playing. (Winter 2022, 4M)
○ Q.5 (b) OR Explain Minimax principal. (Summer 2022, 4M)
■ The Minimax principle, used in game theory and decision
making, is occasionally tested conceptually, sometimes with a
simple game example.
String matching algorithms are concerned with finding occurrences of a pattern string
within a larger text string. Common algorithms tested include the Naive approach
and the Rabin-Karp algorithm, with a particular focus on concepts like spurious hits
in Rabin-Karp. Definitions related to string matching terminology are also examined.
● Topic: Introduction to String Matching
○ Q.5 (a) What is string-matching problem? Define valid shift and invalid
1
shift. (Summer 2022, 3M)
■ Basic definitions related to the string matching problem and its
terminology are common starting points.
● Topic: The naive string matching algorithm
○ Q.5 (c) OR What is Finite Automata? Explain use of finite automata for
string matching with suitable example. (Summer 2022, 7M)
■ The use of finite automata for string matching is occasionally
tested, requiring an explanation of the approach and an
example.
● Topic: The Knuth-Morris-Pratt (KMP) algorithm
○ Q.5 (b) Create an example of string P of length 7 such that, the prefix
function of KMP string matcher returns π=3, π=1 and π=0 (Winter
1
2022, 4M)
■ The KMP algorithm, particularly its prefix function (LPS array),
can be tested, sometimes requiring students to construct
examples or understand its properties.
This chapter delves into the theory of computational complexity, focusing on the
classes P, NP, NP-Complete, and NP-Hard problems. It carries a significant
weightage, and questions are predominantly theoretical, emphasizing definitions and
examples of problems within these classes. Understanding polynomial reduction is
also important. This area tests the conceptual limits of what can be solved efficiently
by algorithms.
● Topic: The class P and NP
1
○ Q.5 (a) OR Explain in Brief: Polynomial reduction. (Winter 2023, 3M)
■ Understanding the concept of polynomial-time reduction is
crucial for the definition of NP-Completeness.
● Topic: NP-Completeness Problem
○ Q.5 (c) OR Explain with example, how the Hamiltonian Cycle problem
can be used to solve the Travelling Salesman problem. (Winter 2022,
1
7M)
■ TSP and Hamiltonian Cycle are classic examples of
NP-Hard/NP-Complete problems. Questions might explore their
relationship or use them as examples.
● Topic: Approximation algorithms
1
○
Concluding Remarks
This compilation of topic-wise questions from past GTU examinations for "Analysis
and Design of Algorithms" (3150703) aims to provide students with a structured and
comprehensive resource for their exam preparation. The analysis of question papers
from Summer 2022 to Winter 2024 reveals several consistent trends:
● Core Topics: Chapters on Analysis of Algorithms (Chapter 2), Divide and
Conquer (Chapter 3), Dynamic Programming (Chapter 4), and Greedy
Algorithms (Chapter 5) form the bulk of the examination, both in terms of
question frequency and mark allocation. NP-Completeness (Chapter 9) is also
heavily tested for its theoretical concepts.
● Question Types: A mix of definitional questions (e.g., properties of
algorithms, asymptotic notations, principle of optimality, P/NP definitions),
analytical questions (e.g., deriving complexities, solving recurrences), and
problem-solving questions (e.g., applying sorting algorithms, MST algorithms,
DP solutions to knapsack/LCS, Huffman coding) is evident.
● Frequently Repeated Questions/Themes:
○ Definitions and applications of Asymptotic Notations.
○ Analysis (best, worst, average case) of basic sorting algorithms
(Insertion, Selection, Bubble, Quick Sort).
○ Solving recurrence relations, especially using the Master Theorem.
○ Application of Merge Sort and Quick Sort.
○ The Principle of Optimality in Dynamic Programming.
○ 0/1 Knapsack (DP), LCS (DP), Matrix Chain Multiplication (DP).
○ Prim's and Kruskal's algorithms for MST.
○ Fractional Knapsack (Greedy) and Huffman Coding.
○ BFS and DFS traversals.
○ N-Queens problem using Backtracking.
○ Rabin-Karp algorithm (spurious hits).
○ Definitions of P, NP, NP-Complete, and NP-Hard problems.
● Diagrams and Step-by-Step Solutions: Many questions, especially those
involving graph algorithms (MST, traversals) or step-wise procedures (sorting,
DP table filling, Huffman tree construction), implicitly or explicitly require
diagrams or detailed procedural steps.
Students are advised to thoroughly understand the fundamental concepts of each
chapter, practice solving problems from each category, and pay special attention to
the frequently repeated themes highlighted in this document. Effective utilization of
this question bank, alongside regular coursework and textbook study, should
significantly enhance preparedness for the university examinations.