0% found this document useful (0 votes)
169 views26 pages

Question Bank ALG

This document contains the question bank for the Design and Analysis of Algorithms course offered in the third semester of B.Tech at Akshaya College of Engineering and Technology. It includes the vision, mission, and objectives of the institution and department. The syllabus covers topics like brute force algorithms, dynamic programming, greedy algorithms, and NP-complete problems over 45 lecture hours. It also lists practical exercises involving algorithms like Strassen's matrix multiplication, topological sorting, the knapsack problem, and the traveling salesman problem. Finally, it provides a reference book for the course.

Uploaded by

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

Question Bank ALG

This document contains the question bank for the Design and Analysis of Algorithms course offered in the third semester of B.Tech at Akshaya College of Engineering and Technology. It includes the vision, mission, and objectives of the institution and department. The syllabus covers topics like brute force algorithms, dynamic programming, greedy algorithms, and NP-complete problems over 45 lecture hours. It also lists practical exercises involving algorithms like Strassen's matrix multiplication, topological sorting, the knapsack problem, and the traveling salesman problem. Finally, it provides a reference book for the course.

Uploaded by

mentalinside
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND

DATA SCIENCE

AD3351 – DESIGN AND ANALYSIS OF ALGORITHMS

QUESTION BANK

FOR III SEMESTER - B.Tech. DEGREE COURSE


[REGULATION - 2021]
AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND


DATA SCIENCE

QUESTION BANK

SUBJECT CODE : AD3351

SUBJECT NAME : DESIGN AND ANALYSIS OF


ALGORITHMS
REGULATION : 2021

ACADEMIC YEAR : 2023 – 2024

YEAR/SEMESTER : II/III

BATCH : 2022 - 2026

Prepared by: Verified by: Approved by:


Name: Name: Name:
Date: Date: Date:

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/2


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

VISION AND MISSION OF THE INSTITUTION

VISION

 Emerge as a premier institute producing globally competent engineers.

MISSION

1. Achieve academic diligence through effective and innovative teaching – learning


processes using ICT tools
2. Make students employable through rigorous career guidance and training programs.
3. Strengthen Industry Institute Interaction through MOUs and collaborations.
4. Promote Research & Development by inculcating creative thinking through innovative
projects incubation.

VISION AND MISSION OF THE DEPARTMENT

VISION
To foster industry cooperation and impart cognitive learning in order to develop professionals
who can adapt to the shifting demands of new trends in artificial intelligence and data science.

MISSION
DM 1: To provide an Excellent infrastructure that keeps up with modern trends and technologies
for students and educators.
DM 2: To impart knowledge in cutting edge technology for Artificial Intelligence and Data
Science with industrial standards.
DM 3: To impart high-quality education embedded with moral and ethical principles.
DM 4: To encourage lifelong learning and research that benefit society as a whole.

PROGRAM OUTCOMES (POS)


PO 1 Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex
engineering problems.
PO 2 Problem analysis: Identify, formulate, review research literature, and analyze

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/3


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

complex engineering problems reaching substantiated conclusions using first


principles of mathematics, natural sciences, and engineering sciences.
PO 3 Design/development of solutions: Design solutions for complex engineering
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
PO 4 Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions.
PO 5 Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
PO 6 The Engineer 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 engineering practice.
PO 7 Environment and Sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
PO 8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
PO 9 Individual and Team work: Function effectively as an individual, and as a member
or leader in diverse teams, and in multidisciplinary settings.
PO 10 Communication: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as, being able to
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
PO 11 Project management and Finance: Demonstrate knowledge and understanding of
the engineering 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.
PO 12 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.

PROGRAM EDUCATIONAL OBJECTIVES (PEO)


PEO1: Prospective Career: Apply the knowledge of basic sciences, mathematics, Artificial
Intelligence, data science and statistics to build a system that requires in analysis of huge
volumes of data.

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/4


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

PEO2: Product Development: Design a model using Artificial Intelligence to solve the critical
problems in real world.
PEO3: Higher Studies: To enable the students to think logically and pursue life-long learning
and collaborate with an ethical attitude in a multidisciplinary team.

PROGRAM SPECIFIC OBJECTIVES (PSO)


PSO1: Create, select and apply the knowledge of AI and Data Science to solve societal
problems.
PSO 2: Develop data analytics and data visualization skills, skills pertaining to knowledge
acquisition, knowledge representation and knowledge engineering, and hence be capable of
coordinating complex projects.   

SYLLABUS:
UNIT DETAILS HOURS
UNIT I INTRODUCTION
Notion of an Algorithm – Fundamentals of Algorithmic Problem Solving – Important
Problem Types –Fundamentals of the Analysis of Algorithm Efficiency – Analysis
I 8
Framework - Asymptotic Notations and their properties – Empirical analysis -
Mathematical analysis of Recursive and Nonrecursive algorithms – Visualization.

UNIT II BRUTE FORCE AND DIVIDE AND CONQUER


Brute Force – String Matching - Exhaustive Search - Traveling Salesman Problem -
Knapsack Problem - Assignment problem. Divide and Conquer Methodology –
II Multiplication of Large Integers and Strassen’s Matrix Multiplication – Closest-Pair 10
and Convex - Hull Problems. Decrease and Conquer: - Topological Sorting –
Transform and Conquer: Presorting – Heaps and Heap Sort.

UNIT III DYNAMIC PROGRAMMING AND GREEDY TECHNIQUE


Dynamic programming – Principle of optimality - Coin changing problem –
III Warshall’s and Floyd‘s algorithms – Optimal Binary Search Trees - Multi stage 10
graph - Knapsack Problem and Memory functions. Greedy Technique – Dijkstra’s
algorithm - Huffman Trees and codes - 0/1 Knapsack problem.
UNIT IV ITERATIVE IMPROVEMENT
IV The Simplex Method-The Maximum-Flow Problem – Maximum Matching in 8
Bipartite Graphs- The Stable marriage Problem.

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/5


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

UNIT V LIMITATIONS OF ALGORITHM POWER


Lower - Bound Arguments - P, NP, NP- Complete and NP Hard Problems.
Backtracking – NQueen problem - Hamiltonian Circuit Problem – Subset Sum
V Problem. Branch and Bound – LIFO Search and FIFO search - Assignment problem 9
– Knapsack Problem – Traveling Salesman Problem - Approximation Algorithms for
NP-Hard Problems – Traveling Salesman problem – Knapsack problem.

TOTAL HOURS 45

PRACTICAL EXERCISES:

1. Implement recursive and non-recursive algorithms and study the order of growth from log2n to n!.
2. Divide and Conquer - Strassen’s Matrix Multiplication
3. Decrease and Conquer - Topological Sorting
4. Transform and Conquer - Heap Sort
5. Dynamic programming - Coin change Problem, Warshall’s and Floyd‘s algorithms, Knapsack Problem
6. Greedy Technique – Dijkstra’s algorithm, Huffman Trees and codes
7. Iterative improvement - Simplex Method
8. Backtracking – N-Queen problem, Subset Sum Problem
9. Branch and Bound - Assignment problem, Traveling Salesman Problem

TEXT/REFERENCE BOOKS:
T/R BOOK TITLE/AUTHORS/PUBLICATION
1. Anany Levitin, Introduction to the Design and Analysis of Algorithms, Third Edition, Pearson
T Education, 2012.
1. Ellis Horowitz, Sartaj Sahni and Sanguthevar Rajasekaran, Computer Algorithms/ C++,
Second Edition, Universities Press, 2019.
2. Thomas H.Cormen, Charles E.Leiserson, Ronald L. Rivest and Clifford Stein,
R Introduction to Algorithms, Third Edition, PHI Learning Private Limited, 2012.
3. S. Sridhar, Design and Analysis of Algorithms, Oxford university press, 2014.
4. Alfred V. Aho, John E. Hopcroft and Jeffrey D. Ullman, Data Structures and
Algorithms, Pearson Education, Reprint 2006.

COURSE OBJECTIVES:
1 To critically analyze the efficiency of alternative algorithmic solutions for the same problem
2 To illustrate brute force and divide and conquer design techniques.
3 To explain dynamic programming and greedy techniques for solving various problems.
4 To apply iterative improvement technique to solve optimization problems
5 To examine the limitations of algorithmic power and handling it in different problems.

COURSE OUTCOMES:
SNO DESCRIPTION
1 Analyze the efficiency of recursive and non-recursive algorithms mathematically

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/6


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

2 Analyze the efficiency of brute force, divide and conquer, decrease and conquer, Transform
and conquer algorithmic techniques
3 Implement and analyze the problems using dynamic programming and greedy algorithmic
techniques.
4 Solve the problems using iterative improvement techniques for optimization.
5 Compute the limitations of algorithmic power and solve the problems using backtracking
and branch and bound techniques.

BLOOM TAXANOMY LEVELS (BTL)

 LEVEL 1 – REMEMBERING (BTL1)


 LEVEL 2 – UNDERSTANDING (BTL2)
 LEVEL 3 – APPLYING (BTL3)
 LEVEL 4 – ANALYZING (BTL4)
 LEVEL 5 – EVALUATING (BTL5)
 LEVEL 6 - CREATING(BTL6)

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/7


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

UNIT I INTRODUCTION
UNIT I INTRODUCTION
Notion of an Algorithm – Fundamentals of Algorithmic Problem Solving – Important Problem Types –
Fundamentals of the Analysis of Algorithm Efficiency – Analysis Framework - Asymptotic Notations and
their properties – Empirical analysis - Mathematical analysis of Recursive and Nonrecursive algorithms –
Visualization.
PART – A
Univ QP (Month/
S.No. Question and Answer CO
Year)
What is performance measurement?
1.

Performance measurement is concerned with obtaining the space and the time
requirements of a particular algorithm.

What is an Algorithm?
2.

An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining
a required output for any legitimate input in a finite amount of time.
all algorithms must satisfy the following criteria:
1) input
2) Output
3) Definiteness
4) Finiteness
5) Effectiveness.

What is space complexity?


3.

The space complexity of an algorithm is the amount of memory it needs to run to completion.
What is time complexity?
4.

The time complexity of an algorithm is the amount of computer time it needs to run to completion.
5. What are Sequential Algorithms?
The central assumption of the RAM model is that instructions are executed one after another, one

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/8


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

operation at a time. Accordingly, algorithms designed to be executed on such machines are called
Sequential algorithms.
6. What are Parallel Algorithms?.
The central assumption of the RAM model does not hold for some newer computers that can execute
operations concurrently, i.e., in parallel algorithms that take advantage of this capability are called
Parallel algorithms
7. What is Exact and Approximation algorithm?
The principal decision to choose solving the problem exactly is called exact algorithm.
The principal decision to choose solving the problem approximately is called Approximation algorithm.
Nov/Dec 2005
8. What is Algorithm Design Technique?

An algorithm design technique is a general approach to solving problems algorithmically that


is applicable to a variety of problems from different areas of computing.
Define Pseudo code.
9.

A Pseudo code is a mixture of a natural language and programming language like constructs. A
pseudo code is usually more precise than a natural language, and its usage often yields more succinct
algorithm descriptions.
10. Define Flowchart.
A method of expressing an algorithm by a collection of connected geometric shapes containing
descriptions of the algorithm’s steps.
11. What is Efficiency of algorithm?
Efficiency of an algorithm can be precisely defined and investigated with mathematical rigor. There are
two kinds of algorithm efficiency
o Time Efficiency – Indicates how fast the algorithm runs
o Space Efficiency – Indicates how much extra memory the algorithm needs.
12. What is generality of an algorithm?
It is a desirable characteristic of an algorithm. Generality of the problem the algorithm solves is
sometimes easier to design an algorithm for a problem posed in more general terms.
13. What is algorithm’s Optimality?
Optimality is about the complexity of the problem that algorithm solves. What is the minimum
amount of effort any algorithm will need to exert to solve the problem in question is called algorithm’s
Optimality.

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/9


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

14. What do you mean by Sorting” problem?


The sorting problem asks us to rearrange the items of a given list in ascending order (or descending order)
15. What do you mean by Searching” problem?
The searching problem deals with finding a given value, called a search key, in a given set.
What do you mean by Worst case-Efficiency” of an
16. algorithm?

The Worst case-Efficiency” of an algorithm is its efficiency for the worst-case input of size n,
which is an input (or inputs) of size n for which the algorithm runs the longest among all possible inputs
of that size.
Ex: if you want to sort a list of numbers in ascending order when the numbers are given in
descending order. In this running time will be the longest.
What do you mean by Best case-Efficiency” of an algorithm?
17.

The Best case-Efficiency” of an algorithm is its efficiency for the Best-case input of size n,
which is an input(or inputs) of size n for which the algorithm runs the fastest among all possible inputs of
that size.
Ex: if you want to sort a list of numbers in ascending order when the numbers are given in
ascending order. In this running time will be the smallest.
18 Define the Average-case efficiency” of an algorithm?
The Average-case efficiency” of an algorithm is its efficiency for the input of size n, for which
the algorithm runs between the best case and the worst case among all possible inputs of that size.

19. How to measure the algorithm’s efficiency?


It is logical to investigate the algorithm’s efficiency as a function of some parameter n indicating
the algorithm’s input size.
Example: It will be the size of the list for problems of sorting, searching, finding the list’s smallest
element, and most other problems dealing with lists.
20. What is called the basic operation of an algorithm?
The most important operation of the algorithm is the operation contributing the most to the total running
time is called basic operation of an algorithm.
21. How to measure an algorithm’s running time?
Let Cop be the time of execution of an algorithm’s basic iteration on a particular computer and let
C (n) be the number of times this operation needs to be executed for this algorithm. Then we can estimate
the running time T(n) of a program implementing this algorithm on that computer by the formula

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/10


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

T(n) ≈ Cop C(n)

22. Define order of growth.


The efficiency analysis framework concentrates on the order of growth of an algorithm’s basic operation
count as the principal indicator of the algorithm’s efficiency. To compare and rank such orders of growth
we use three notations
1) O (Big oh) notation
2) Ω (Big Omega) notation &
3) Θ (Big Theta) notation

Define Big oh notation May/June 2006,


23.
April/May 2008
A function t(n) is said to be in O(g(n)) denoted t(n) ε O (g(n)), if t(n) is bounded above by some constant
multiple of g(n) for all large n, i.e., if there exist some positive constant c and some non negative integer
n0 such that
T (n) < c g (n) for n > n0
24. Prove that 100n+5  O (n2)?
Clearly 100n+5  100n+n (for all n  5) = 101n101n2
By choosing n0=5 and c=101 we find that 100n+5O (n2).

Define Ω notation
25.

A function t(n) is said to be in Ω (g(n)), denoted t(n)  Ω (g(n)), if t(n) is bounded below by some
positive constant multiple of g(n) for all large n, i.e., if there exist some positive constant c and some non
negative integer n0 such that
T (n) < c g (n) for n > n0
26. Prove that n3(n2)?
Clearly n3  n2 for all n  0. i.e., we can select c=1 and n0=0.
Write algorithm using iterative function to fine sum of n
27.
numbers.
Algorithm sum(a,n)
{ S : = 0.0
For i=1 to n do
S : - S + a[i];

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/11


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

Return S;
}

Write an algorithm using Recursive function to fine sum of n


28.
numbers,
Algorithm Rsum (a,n)
{
If(n_ 0) then
Return 0.0;
Else Return Rsum(a, n- 1) + a(n);

PART – B
Univ QP (Month/
S.No. Question and Answer CO
Year)
NOV/DEC 2017,
1 Describe the steps in analyzing & coding an algorithm CO1
APRIL/MAY 2018
 Steps in analyzing and coding the algorithm
 Example algorithm

2 Discuss the fundamentals of analysis framework . CO1 MAY/JUNE 2016

 Analysis of algorithm
 Example
 complexity
Explain the various asymptotic notations used in algorithm
3 CO1
design.
 Big Oh
 Big Theta
 Big Omega
4. Explain the basic efficiency classes. CO1

5. What is Pseudo-code? Explain with an example. CO1


 Definition
 Example

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/12


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

 Explanation
Set up & solve a recurrence relation for the number of key
6. CO1
comparisons made by above pseudo code.
Recurrences
Solve recurrence relation
. PART – C
Univ QP (Month/
S.No. Question and Answer CO
Year)
Explain about binary search with example
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Explain about linear search with example.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Explain about insertion sort with example.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Explain about heap sort with example.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/13


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

UNIT II - GRAPH ALGORITHMS


Graph algorithms: Representations of graphs – Graph traversal: DFS – BFS – applications – Connectivity,
strong connectivity, bi-connectivity – Minimum spanning tree: Kruskal’s and Prim’s algorithm- Shortest
path: Bellman-Ford algorithm – Dijkstra’s algorithm – Floyd-Warshall algorithm Network flow: Flow

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/14


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

networks – Ford-Fulkerson method – Matching: Maximum bipartite matching


PART – A
Univ QP (Month/
S.No. Question and Answer CO
Year)
1 Write the definition of weighted graph?
A graph in which weights are assigned to every edge is called a weighted graph.
2 Define Graph
A graph G consist of a nonempty set V which is a set of nodes of the graph, a set E which is the set of
edges of the graph, and a mapping from the set of edges E to set of pairs of elements of V. It can also be
represented as G=(V, E).
3 Define adjacency matrix?
The adjacency –matrix is an n x n matrix A whose elements aij are given by aij = 1 if (vi, vj) Exists =0
4 Define adjacent nodes?
Any two nodes, which are connected by an edge in a graph, are called adjacent nodes. For example, if an
edge x E is associated with a pair of nodes (u,v) where u, v V, then we say that the edge x connects the
nodes u and v.
5 What is a directed graph?
A graph in which every edge is directed is called a directed graph.
6 What is an undirected graph?
A graph in which every edge is undirected is called an undirected graph.
7 What is a loop?
An edge of a graph, which connects to itself, is called a loop or sling.
8 What is a simple graph?
A simple graph is a graph, which has not more than one edge between a pair of nodes.
9 What is a weighted graph?
A graph in which weights are assigned to every edge is called a weighted graph.
10 Define indegree and out degree of a graph?
In a directed graph, for any node v, the number of edges, which have v as their initial node, is called the
out degree of the node v. Outdegree: Number of edges having the node v as root node is the outdegree of
the node v.
11 Define path in a graph?
The path in a graph is the route taken to reach terminal node from a starting node. CS8391-Data
Structures

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/15


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

12 What is a simple path?


A path in a diagram in which the edges are distinct is called a simple path. ii. It is also called as edge
simple.
13 What is a cycle or a circuit?
A path which originates and ends in the same node is called a cycle or circuit.
14 What is an acyclic graph?
A simple diagram, which does not have any cycles, is called an acyclic graph.
15 What is meant by strongly connected in a graph?
An undirected graph is connected, if there is a path from every vertex to every other vertex. A directed
graph with this property is called strongly connected.
16 When a graph said to be weakly connected?
aij = 1 if (vi, vj) Exists =0 otherwise When a directed graph is not strongly connected but the underlying
graph is connected, then the graph is said to be weakly connected.
Name the different ways of representing a graph? Give
17
examples
a. Adjacency matrix b. Adjacency list
18 What is an undirected acyclic graph?
When every edge in an acyclic graph is undirected, it is called an undirected acyclic graph. It is also
called as undirected forest.
19 What is the use of BFS?
BFS can be used to find the shortest distance between some starting node and the remaining nodes of the
graph. The shortest distance is the minimum number of edges traversed in order to travel from the start
node the specific node being examined.
20 What is topological sort?
It is an ordering of the vertices in a directed acyclic graph, such that: If there is a path from u to v, then v
appears after u in the ordering.
Write BFS algorithm
21

1. Initialize the first node’s dist number and place in queue


2. Repeat until all nodes have been examined
3. Remove current node to be examined from queue
4. Find all unlabeled nodes adjacent to current node
5. If this is an unvisited node label it and add it to the queue

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/16


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

6. Finished.
22 Define biconnected graph?
A graph is called biconnected if there is no single node whose removal causes the graph to break into two
or more pieces. A node whose removal causes the graph to become disconnected is called a cut vertex.
What are the two traversal strategies used in traversing a
23
graph?
a. Breadth first search
b. Depth first search
24 Define articulation point.
Articulation Points (or Cut Vertices) in a Graph A vertex in an undirected connected graph is an
articulation point (or cut vertex) if removing it (and edges through it) disconnects the graph. Articulation
points represent vulnerabilities in a connected network – single points whose failure would split the
network into 2 or more disconnected components. They are useful for designing reliable networks.
PART – B
Univ QP (Month/
S.No. Question and Answer CO
Year)
Explain the various representation of graph with example in
1
detail?
 Adjacency Matrix
 Adjecency List
2 Define topological sort? Explain with an example?
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
3 Explain Dijkstra's algorithm with an example?
 Introduction
 Explanation
 Example
 Algorithm
 Complexity

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/17


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

4 Explain Prim's algorithm with an example?


 Introduction
 Explanation
 Example
 Algorithm
 Complexity
5 Explain Krushal's algorithm with an example?
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
6 Explain Floyd-Warshall algorithm for Network flow
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
7 Explain Ford-Fulkerson method
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
PART – C
Univ QP (Month/
S.No. Question and Answer CO
Year)
1 Explain the breadth first search algorithm
 Introduction
 Explanation
 Example
 Algorithm

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/18


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

 Complexity
2 Explain the depth first search algorithm
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Write and explain the prim’s algorithm and depth first search
3
algorithm.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity

UNIT III ALGORITHM DESIGN TECHNIQUES


Divide and Conquer methodology: Finding maximum and minimum – Merge sort – Quick sort Dynamic
programming: Elements of dynamic programming — Matrix-chain multiplication – Multi stage graph —
Optimal Binary Search Trees. Greedy Technique: Elements of the greedy strategy – Activity-selection

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/19


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

problem –- Optimal Merge pattern — Huffman Trees.


PART – A
Univ QP (Month/
S.No. Question and Answer CO
Year)
Define the divide an conquer method.
1

Given a function to compute on ‘n’ inputs the divide-and-comquer strategy suggests splitting the inputs in
to’k’ distinct susbsets, 1<k <n, yielding ‘k’ subproblems.
The subproblems must be solved, and then a method must be found to combine subsolutions into a
solution of the whole. If the subproblems are still relatively large, then the divide-and conquer strategy
can possibly be reapplied.

Define control abstraction.


2.

A control abstraction we mean a procedure whose flow of control is clear but whose primary operations
are by other procedures whose precise meanings are left undefined.

3. Write the Control abstraction for Divide-and conquer.


Algorithm DAnd(r)
{
if small(p) then return S(r);
else
{
divide P into smaller instance _ 1, _ 2, _ k, k ³ 1;
Apply D and C to each of these subproblems
Return combine (DAnd C(_1) DAnd C(_2),----, DAnd ((_k));
}
}

What are internal nodes?


4.

The circular node is called the internal nodes.

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/20


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

5. Describe the recurrence relation ofr merge sort?


If the time for the merging operation is proportional to n, then the computing time of merge sort is
described by the recurrence relation
n = 1, a a constant
T(n) = a
2T (n/2) + n n >1, c a constant
6. What is meant by feasible solution?
Given n inputs and we are required to form a subset such that it satisfies some given constraints then such
a subset is called feasible solution.
7. Write any two characteristics of Greedy Algorithm?
* To solve a problem in an optimal way construct the solution from given set of candidates.
* As the algorithm proceeds, two other sets get accumulated among this one set contains the candidates
that have been already considered and chosen while the other set contains the candidates that have been
considered but rejected.
8. Define optimal solution?
A feasible solution either maximizes or minimizes the given objective function is called as optimal
solution
9. Define Dynamic Programming
Dynamic programming is a technique for solving problems with overlapping problems.
Typically, these subproblems arise from a recurrence relating a solution to a given problem with solutions
to its smaller subproblems of the same type. Rather than solving overlapping subproblems again and
again, dynamic programming suggests solving each of the smaller sub problems only once and recording
the results in a table from which we can then obtain a solution to the original problem.

Give computing time for Bianry search?


10.

In conclusion we are now able completely describe the computing time of binary
search by giving formulas that describe the best, average and worst cases.
Successful searches
q(1) q(logn) q(Logn)
best average worst
unsuccessful searches
q(logn)

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/21


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

best, average, worst


Write the algorithm for Iterative binary search?
11.

Algorithm BinSearch(a,n,x)
//Given an array a[1:n] of elements in nondecreasing
// order, n>0, determine whether x is present
{
low : = 1;
high : = n;
while (low < high) do
{
mid : = [(low+high)/2];
if(x < a[mid]) then high:= mid-1;
else if (x >a[mid]) then low:=mid + 1;
else return mid;
}
return 0;
}
12. Define external path length?
The external path length E, is defines analogously as sum of the distance of all
external nodes from the root.

13. Define internal path length.


The internal path length ‘I’ is the sum of the distances of all internal nodes from
the root.
Is insertion sort better than the merge sort?
14.

Insertion sort works exceedingly fast on arrays of less then 16 elements, though for
large ‘n’ its computing time is O(n2).

What is the maximum and minimum problem?


15.

The problem is to find the maximum and minimum items in a set of ‘n’ elements. Though
this problem may look so simple as to be contrived, it allows us to demonstrate divideand-comquer in

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/22


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

simple setting.

16 What is the Quick sort?


In quicksort, the division into subarrays is made so that the sorted subarrays do not need to be merged
later.

17 Write the Anlysis for the Quick sort.


In analyzing QUICKSORT, we can only make the number of element comparisions c(n). It is easy to see
that the frequency count of other operations is of the same order as C(n).

Write a algorithm for straightforward maximum and


18. minimum>

algorithm straight MaxMin(a,n,max,min)


//set max to the maximum and min to the minimum of a[1:n]
{
max := min: = a[i];
for i = 2 to n do
{
if(a[i] >max) then max: = a[i];
if(a[i] >min) then min: = a[i];
}
}
19. Give the recurrence relation of divide-and-conquer?
The recurrence relation is
T(n) = g(n)
T(n1) + T(n2) + ----+ T(nk) + f(n)

PART – B
Univ QP (Month/
S.No. Question and Answer CO
Year)
1 Write Shote notes on
Divide and conquer Strategy

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/23


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

Dynammic Programming
 Adjacency Matrix
 Adjecency List
2 Explain with an example Huffman Trees.algorithm
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
3 Explain Optimal Merge pattern
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Explain Greedy Technique for activity-selection
4
problem
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Explain Optimal Binary Search Trees with dynamic
5
programming
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
6 Explain Multi stage graph with dynamic programming.
 Introduction
 Explanation

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/24


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

 Example
 Algorithm
 Complexity
7 Explain dynamic programming with Matrix-chain multiplication.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
PART – C
Univ QP (Month/
S.No. Question and Answer CO
Year)
Explain the algorithm to finding maximum and minimum using
1
divide and conquer algorithm.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
2 Explain Merge sort using divide and conquer method
 Introduction
 Explanation
 Example
 Algorithm
 Complexity
Write and explain the Quick sort using divide and conquer
3
algorithm.
 Introduction
 Explanation
 Example
 Algorithm
 Complexity

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/25


AKSHAYA COLLEGE OF ENGINEERING AND TECHNOLOGY

R2021 / CSE / CS3401 – ALGORITHMS / II YEAR / IV SEM/QB/26

You might also like