BCS 042
BCS 042
com/papers/
SECTION-A
1. (a) Put the following classes of algorithms in 2
increasing order of growth :
(i) 0(n)
(ii) 0(211)
1
log 2 )
(iii) 0 (Oog
(iv) 0(0
(b) Write the names of the following symbols : 3
(i) 0
(ii) n
(iii) v
(c) Write the values of the followings : 3
(i) [4.4]
(ii) [ —4.4]
(iii) log2(4+16)
BCS-042 1 P.T.O.
BCS-042 2
SECTION-B
if(n = =1)
return 1
else
return n*FACT(n —1)
BCS-042 3 P.T.O.
BCS-042 4
.1"
BACHELOR OF COMPUTER APPLICATIONS
C) (Revised)
Term-End Examination
December, 2013
BCS-042 : INTRODUCTION TO ALGORITHM
DESIGN
Time : 2 hours Maximum Marks : 50
Note : Question number 1 is compulsory. Answer any three
from the rest.
SECTION - A
1. (a) Put the following classes of algorithms in 2
increasing order of growth.
(i) 0 (n logo)
(ii) 0(logn)
(iii) 0(n2)
(iv) 0 (VT-1)
(b) Define three most common asymptotic 3
notations and its meanings.
(c) Write the values of the followings 3
(i) [3.3]
27
(ii) log 3T
[- 3.3]
BCS-042 1 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 6
Download from:- https://www.ignouassignmentguru.com/papers/
SECTION - B
2. Write a Pseudo - code for prim's Algorithm to find 10
Minimum cost spanning tree. Apply prim's
Algorithm and find minimum spanning tree for
the following graph (Starting vertex is 1).
BCS-042 2
https://www.ignouassignmentguru.com/ Page No. 7
Download from:- https://www.ignouassignmentguru.com/papers/
if(n = = 0) return 0
if(n = =1) return 1
else
return (Fib(n —1) + Fib(n —2))
BCS-042 3
https://www.ignouassignmentguru.com/ Page No. 8
Download from:- https://www.ignouassignmentguru.com/papers/
SECTION - A
1. (a) Given the following list of 8 integers, sort 8
them using insertion sort. Determine the
number of comparisons used by the sorting
algorithm as well as the total number of
assignment operations.
25 15 7 10 8 12 6 13
Show the process of sorting.
(b) Define 0 (big theta) notation. By using a 4
basic definition show that
5n2 + 9n — 8 = (n2) .
(c) Draw all the spanning trees of the following 3
weighted connected graph.
BCS-042 1 P.T.O.
SECTION - B
2. Define a fractional knapsack problem. Find the 10
optimal solution to the following instance of a
knapsack problem. Show step by step running of
the algorithm.
Number of object ; n =5
Capacity of knapsack ; M =10
(P1, P2, P3, P4, P5) (12, 32, 40, 30, 50)
Where Pi is profit
and
(W1, W2, W3, W4, W5) = (4, 8, 2, 6, 1)
Where Wi - is weight
Each object has a profit Pi and weight Wi. The
problem is to fill a knapsack (up to its maximum
capacity M) which maximises the total profit
earned.
BCS-042 2
BCS-042 3
SECTION A
35 8 7 15 25 30 10 12
Perform worst case analysis. 10
(ii) Prove or disprove the following using the
basic definition of 0 (big Oh) : 2
5n2 + 8n + 15 = 0(n2)
BCS-042 1 P.T.O.
BCS-042 2
SECTION B
8 14 20 25 35 45 50 85 95 100
BCS-042 3 P.T.O.
BCS-042 4 6,000
BCS-042 . P.T.O.
15 5 8 7 4 20 25
BCS-042 2
https://www.ignouassignmentguru.com/ Page No. 17
Download from:- https://www.ignouassignmentguru.com/papers/
BCS-042 3 6,000
0 40
No. of Printed Pages : 3 BCS-042
BCS-042 1 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 19
Download from:- https://www.ignouassignmentguru.com/papers/
15 5 10 8 7 2 20 30
BCS-042 2
https://www.ignouassignmentguru.com/ Page No. 20
Download from:- https://www.ignouassignmentguru.com/papers/
BCS-042 3 7,000
https://www.ignouassignmentguru.com/ Page No. 21
Download from:- https://www.ignouassignmentguru.com/papers/
10
BCS-042 1 P.T.O.
10 7 12 6 8 15 25 11
BCS-042 2
BCS-042 3 6,000
BCS-042 1 P.T.O.
BCS-042 2
2 8 7 3 5 6 4
BCS-042 3 6,500
(i) 0(n3)
(ii) 0(2n)
(iii) 0(log n)
(iv) 0( )
BCS-042 1 P.T.O.
4 12 3
BCS-042 2
T(n) = 3T (—
n ) + n. 5
2
(b) Write the Breadth First search algorithm
and calculate its time complexity. 5
BCS-042 3 6,000
(i) 0(log n)
0(n3)
(iii) 0(5n)
Figure 1
Figure 2
BCS-042 2
2 4 3 9
C 6 D 2 F
Figure 3
BCS-042 3 P.T.O.
(c) Backtracking
BCS-042 4 5,500
Term-End Examination
June, 2018
CI 6 .7 ._"_1*
T(n) = 3T( —
n ) + n log n
4
(b) Write algorithm of bubble sort.
BCS-042 7,000
Term-End Examination
ODD ex.
December, 2018
g(n) = 2n2 + 3.
BCS-042 P.T.O.
i = i * 2;
T(n) = 4T(1-1- ) + n
2
BCS-042 3 P.T.O.
BCS-042 4 4,500
04292
No. of Printed Pages : 4 BCS-042
(i) 0 (n 2)
(ii) 0 (log n)
(iii) 0 (2")
(iv) 0 (n log n)
(ii) 3n 2 + 5 = 19(n 2 )
(n '"
BCS-042 (2)
https://www.ignouassignmentguru.com/ Page No. 43
Download from:- https://www.ignouassignmentguru.com/papers/
10 15 7 6 20 9
[5]
ifA[j]>B[i]
Print A [ j ];
5344
No. of Printed Pages : 4 BCS-042
1. (a) Let f(n) and g(n) are two positive functions, using
basic definition of Big Oh ("0") and Theta (0),
prove/disprove the following : [5]
T(n) = 2T (n-1) + 1
BCS-042/6500
( 1 ) 1111111111111111111111111111
https://www.ignouassignmentguru.com/ Page No. 46
Download from:- https://www.ignouassignmentguru.com/papers/
BCS-042/6500 (2)
https://www.ignouassignmentguru.com/ Page No. 47
Download from:- https://www.ignouassignmentguru.com/papers/
n
(i) T (n) = 2T ( \ +n
(n
(ii) T (n) = 3T — + n log n
\4)
BCS-042/6500 ( 3 ) [P.T.O.]
https://www.ignouassignmentguru.com/ Page No. 48
Download from:- https://www.ignouassignmentguru.com/papers/
10
(4)
BCS-042/6500https://www.ignouassignmentguru.com/ Page No. 49
Download from:- https://www.ignouassignmentguru.com/papers/
Term-End Examination
(W1, W2, W3, W4, W5, W6) = (5, 10, 12, 13, 15, 20)
(b) Write recurrence relation for binary search
algorithm. 3
4. (a) Solve the following recurrence relation: 3
T (n) = 3T (n 12) + n
(b) Find minimum cost spanning tree for the
following graph using Kruskal's algorithm: 7
-x -
BACHELOR OF COMPUTER
APPLICATIONS (BCA)
Term-End Examination
December, 2020
BCS-042 : INTRODUCTION TO ALGORITHM
DESIGN
Lot-I P. T. O.
[2] BCS-042
[3] BCS-042
P. T. O.
[4] BCS-042
where Wi is a weight.
BCS–042
BCS-042 1 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 58
Download from:- https://www.ignouassignmentguru.com/papers/
BCS-042 3 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 60
Download from:- https://www.ignouassignmentguru.com/papers/
[2] BCS-042
BACHELOR OF COMPUTER 6x 2 6x 1 O ( x 2 )
Term-End Examination
December, 2021
BCS-042 : INTRODUCTION TO ALGORITHM
DESIGN
P. T. O.
(b) (i) Traverse the following graph using 4. (a) Write a recurrence relation for the
BFS. The starting node is A : 4 following recursive factorial function : 3
P. T. O.
BCS-042 1 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 63
Download from:- https://www.ignouassignmentguru.com/papers/
Starting vertex is A.
BCS-042 2
https://www.ignouassignmentguru.com/ Page No. 64
Download from:- https://www.ignouassignmentguru.com/papers/
BCS-042 3 P.T.O.
https://www.ignouassignmentguru.com/ Page No. 65
ASSIGNMENT
GURU
Established in 2014
SALE UPTO
50% OFF
Shop with a simple mind and be rest IGNOU Last 10 Year IGNOU Sample
assured that your online shopping Question Papers for Papers, Guess Papers,
all Programmes in Important Questions
experience with Assignment GURU is
One PDF for Exams
going to be the simplest in the least Single Click Download Download IN PDF
times and we have a smooth delivery
function to deliver customers an
extreme online Experience.