0% found this document useful (0 votes)
4 views

Algorithm question

This document outlines the model examination for the B.E. Computer Science and Engineering program at Shivani Engineering College, Trichy, focusing on the Algorithms course. It includes details on the examination structure, covering various topics such as algorithm analysis, graph representations, and problem-solving techniques. The exam consists of multiple parts with questions that assess both theoretical knowledge and practical application of algorithms.

Uploaded by

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

Algorithm question

This document outlines the model examination for the B.E. Computer Science and Engineering program at Shivani Engineering College, Trichy, focusing on the Algorithms course. It includes details on the examination structure, covering various topics such as algorithm analysis, graph representations, and problem-solving techniques. The exam consists of multiple parts with questions that assess both theoretical knowledge and practical application of algorithms.

Uploaded by

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

SHIVANI ENGINEERING COLLEGE, TRICHY

DEPARTMENT OF COMPUTER SCIENCE AND


ENGINEERING

MODEL EXAMINATION

Program & Branch B.E & CSE Year /Semester 02 / IV

Course Code & Name CS3401- Algorithms Date 12.05.2025

Max Marks: 100


Regulation 2021
Duration : 3 hours
PART – A (10× 2 = 20 Marks) Blooms COs Mark
SI NO level
ANSWER ALL QUESTIONS
1. State how the running time of an algorithm is measured. Re CO1 2
2. Outline the significance of performing worst case analysis of an algorithm. Re CO1 2
3. List the data structures that are used for representing graphs. Re CO2 2
4. What is a strongly connected graph? Give an example. Ap CO2 2
5. What kinds of problems are solved using divide and conquer approach? Re CO3 2
6. State the elements of greedy approach. Ap CO3 2
7. With an example, define Hamiltonian circuit. Re CO4 2
8. Why is branch and bound approach found to be appropriate for solving CO4
Re 2
travelling salesman problem?
9 State the differences between tractable and non-tractable problem. Re CO5 2
10. When is a problem said to be NP-hard? Give an example. Re CO5 2
PART – B (5 × 13= 65 Marks)
ANSWER ALL QUESTIONS
11. a) i) Explain in detail about various asymptotic notations and their properties.
Re CO1 8+5
ii) Use substitutions method to show that T(n)=2T(n/2) +n is O (n log(n))
OR
b) i) with a suitable example, illustrate the time and space complexity analysis of
binary search and linear search.
Ap CO1 8+5
ii) explain the working of naïve string-matching algorithm with
ABCCDDAEFG as the text input and CDD as the search string
12. a) i) write the pseudocode for BFS and DFS traversal on the graph given below
in fig(a) (i) and compare the time and space complexity of the two traversals.

ii) (ii) Find the Minimum Spanning Tree of the following graph in fig. 12 (a)
(ii) using Kruskal's algorithm. Re CO2 7+6

OR
b) i) Given a graph and a source vertex in the graph, find the shortest paths from
the source vertex 0 to all vertices in the given graph 12 (b) (i)

Ap CO2 8+5
ii) Using Ford-Fulkerson algorithm finds the maximum possible flow in the
network given below Fig 12 (b) (ii)
13 a) i) Demonstrate divide and conquer approach by Performing quick sort on the
following values. 44, 3, 11, 55, 77, 90, 4o, 60, 99, 22, 88 Ap CO3 7+6
ii) Using Dynamic programming. Solve matrix chain multiplication
problem.
OR
b) i) Solve the following problem using Greedy algorithm. Given activities with
their start and finish times, select the maximum number of activities that can
be performed by a single person, assuming that a person can only work on a
single activity at a time.

(ii) A character-coding problem. A data fle of 100,000 characters contains


only the characters a-f, with the frequencies indicated below
Re CO3 8+5
A B C D E F
_____________________________________________________________

Frequency (in thousands) 45 13 12 16 9 5

Show the steps in constructing the final Huffman tree representing the optimal
prefix code.

14. i) Explain the steps in solving n-queens problem using backtracking


a) approach
Ap CO4 8+5
ii) Solve the following subset sum problem using back tracking. Let
S=(37,913,26,41}: d(sum) = 51..
OR
b) i)Discuss briefly the general method of branch and Bound approach and state
how it differs from backtracking.
Ap CO4 8+5
ii)Explain the branching mechanism in the Branch and Bound
Strategy to solve O/1 Knapsack problem.
15. i)Show that if an algorithm makes almost a constant number of calls to
a) polynomial time subroutines and performs an additional amount of work that
also takes polynomial time, then it runs in polynomial time.
Re CO5 8+5
ii)Show that the satisfiability of Boolean formulas in 3-conjunctive normal
form (3- CNF) is NP-complete.
OR
b) i)Illustrate polynomial-time approximation scheme for the sum of
subsets problem.

ii)Illustrate the working of Miller-Rabin randomized primality test. (6) Re CO5 7+6

PART – C (1 × 15= 15 Marks)


16. How many spurious hits does the Rabin-Karp matcher encounter in the text T
a) =3141592653589793 when working modulo q= 1l and looking for the pattern
P = 26. Briefly write about the processing time, worst-case running time and
average-case running time of Rabin-Karp algorithm. Ap 10+5

ii) With an example to show the best-case, worst-case and average case
analysis of heap sort.
OR
b) i) Run the Bellman-Ford algorithm on the directed graph of figure 16 (b) ()
below using vertex s as the source and show the results after each pass of an
algorithm.

Re CO1 7+8

ii) With an example, show that the cardinality of a maximum matching M in a


bipartite graph G equals the value of a maximum flow f in its corresponding
flow network G'.

______________________

You might also like