03 - BCS045 Algorithm Desigm
03 - BCS045 Algorithm Desigm
2. Write a program to sort the following list of numbers using Bubble Sort
algorithm :
15 27 5 2 85 45 30
Calculate
(a) how many times the outer loop and inner loop will execute, and
(b) how many exchange operations will execute. 20
BCSL-045(P)/S 1 1 3,000
No. of Printed Pages : 1 BCSL-045(P)/S1
1. Write a program to evaluate a polynomial using Horner's rule and count how
many times the loop will execute. 20
2. Write a 'C' program to perform linear search and apply it to the following set of
integers to search for a number 28 :
9 15 22 5 4 25 28
Calculate the number of comparison operations required. 20
BCSL-045(P)/S1 1 2,000
No. of Printed Pages : 1 I BCSL 045(P)/S1
-
BCSL-045(P)/S1 1 3,000
No. of Printed Pages : 2 1 . . 1")
/.:
•
BCSL-04581
Bachelor of Computer
Application (Revised) (BCA)
Term-End Examination
December. 2018
•
INTRODUCTION TO ALGORITHM
DESIGN LAB
(A4) P. T. 0.
[2]
1. Write a program to combine any two given strings. Calculate the number
of times the loop will execute and the number of comparison operations
required in this program. 20
How many times will the inner loop execute and number of key
comparisons required. 20
BCSL-045/S1(R) 500
(A-8)