Gujarat Technological University

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Enrolment No.

/Seat No_____________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–V (NEW) EXAMINATION – SUMMER 2024
Subject Code:2150703 Date:16-05-2024
Subject Name:Analysis and Design of Algorithms
Time:02:30 PM TO 05:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.

Q.1 (a) Define the following terms: algorithm, set, function, relation, vector, matrix, 07
linear inequality.
(b) 1. State the general characteristics of the greedy method. 07
2. State the general characteristic of the dynamic programming method.
Q.2 (a) Apply asymptotic notations to sequential search and binary search techniques and 07
find their time complexities in best case, average case and worst case.
(b) Solve the following recurrence relations. 07
1. T(n) = 2T(n/2) + n
2. T(n) = T(n-1) + n
OR
(b) Prove that Hamiltonian problem is NP-Complete problem. 07
Q.3 (a) Solve sorting problem using divide and conquer strategy and show its working 07
applying steps on the array [27, 45, 90, 12, 5, 60].
(b) Solve following knapsack problem using greedy method. Knapsack capacity = 07
60 kg.
Item Weight Value
A 5 30
B 22 77
C 10 40
D 15 45
OR
Q.3 (a) 1. Illustrate the operation of BUILD-MAX-HEAP on the array A = (5, 3, 17, 10, 07
84, 19, 6, 22, 9).
2. Illustrate the operation of HEAPSORT on the array A = (5, 13, 2, 25, 7, 17,
20, 8, 4).
(b) Explain how assembly line scheduling problem can be solved using dynamic 07
programming method.
Q.4 (a) Solve the following instance of making change problem using dynamic 07
programming method.
N=Rs. 8, Coins: Rs. 1, Rs. 4, Rs. 6
(b) Write depth first search algorithm and show its execution on a sample graph. 07
OR
Q.4 (a) Solve the following instance of making change problem using greedy method. 07
N=Rs. 8, Coins: Rs. 1, Rs. 4, Rs. 6
(b) Write breadth first search algorithm and show its execution on a sample graph. 07
Q.5 (a) Apply and illustrate how 8-Queen problem can be solved using backtracking 07
method.
1
(b) Write Naïve string matching algorithm. Apply it to the pattern P = 0001 and the 07
text T = 000010001010001. Compute the number of comparisons required to find
pattern P in the text T.
OR
Q.5 (a) Find all the connected components from the following graph. 07

(b) Define NP-Complete problem. Define class P and class NP. List the problems 07
that fall under classes P, NP and NPC.

*************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy