BCS 042 2
BCS 042 2
BCS 042 2
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.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
SECTION-B
if(n = =1)
return 1
else
return n*FACT(n —1)
BCS-042 3 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 4
Download More:- https://www.ignouassignmentguru.com/papers
.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.
Download More:- 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
Download More:- 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
Download More:- 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.
Download More:- https://www.ignouassignmentguru.com/papers
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
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 3
Download More:- https://www.ignouassignmentguru.com/papers
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.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
SECTION B
8 14 20 25 35 45 50 85 95 100
BCS-042 3 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 4 6,000
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 . P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
15 5 8 7 4 20 25
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 3 6,000
Download More:- https://www.ignouassignmentguru.com/papers
0 40
No. of Printed Pages : 3 BCS-042
BCS-042 1 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
15 5 10 8 7 2 20 30
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 3 7,000
Download More:- https://www.ignouassignmentguru.com/papers
10
BCS-042 1 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
10 7 12 6 8 15 25 11
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 3 6,000
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 1 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
2 8 7 3 5 6 4
BCS-042 3 6,500
Download More:- https://www.ignouassignmentguru.com/papers
(i) 0(n3)
(ii) 0(2n)
(iii) 0(log n)
(iv) 0( )
BCS-042 1 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
4 12 3
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
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
Download More:- https://www.ignouassignmentguru.com/papers
(i) 0(log n)
0(n3)
(iii) 0(5n)
Figure 1
Figure 2
BCS-042 2
Download More:- https://www.ignouassignmentguru.com/papers
2 4 3 9
C 6 D 2 F
Figure 3
BCS-042 3 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
(c) Backtracking
BCS-042 4 5,500
Download More:- https://www.ignouassignmentguru.com/papers
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
Download More:- https://www.ignouassignmentguru.com/papers
Term-End Examination
ODD ex.
December, 2018
g(n) = 2n2 + 3.
BCS-042 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
i = i * 2;
T(n) = 4T(1-1- ) + n
2
BCS-042 3 P.T.O.
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042 4 4,500
Download More:- https://www.ignouassignmentguru.com/papers
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)
Download More:- 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
Download More:- https://www.ignouassignmentguru.com/papers
BCS-042/6500 (2)
Download More:- 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.]
Download More:- https://www.ignouassignmentguru.com/papers
10
BCS-042/6500 (4)
Download More:- 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 -
Download More:- https://www.ignouassignmentguru.com/papers
BACHELOR OF COMPUTER
APPLICATIONS (BCA)
Term-End Examination
December, 2020
BCS-042 : INTRODUCTION TO ALGORITHM
DESIGN
Lot-I P. T. O.
Download More:- https://www.ignouassignmentguru.com/papers
[2] BCS-042
[3] BCS-042
P. T. O.
Download More:- https://www.ignouassignmentguru.com/papers
[4] BCS-042
where Wi is a weight.
BCS–042
No. of Printed Pages : 3 BCS-042
BCS-042 1 P.T.O.
(c) Sort the following list of elements using
‘Insertion Sort’. Also, show intermediate
steps.
28, 6, 29, 90, 5, 42, 80 6
(d) Write the recurrence relation for the best
case of Quicksort algorithm and solve it
using Master method. 6
BCS-042 3 P.T.O.
[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.
[3] BCS-042 [4] BCS-042
(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.