Assignment I G11934 20251
Assignment I G11934 20251
1a) Write the algorithm to find the LCM (Least Common Multiple) of two given number using GCD Algorithm
of Euclid.
1b) Using limit, compare the order of the growth of functions using limit.
a) 3n & n4
b) n3 & n2log2n
c) nlog3n &log3n2
3b) Solve the Assignment problem at the head office of a company there are five registration counters. Five
persons are available for service. How should the counters be assigned to persons so as to maximize the
profit?
C/P A B C D E
1 30 35 40 45 50
2 20 50 40 43 60
3 35 56 45 65 56
4 30 50 45 57 52
5 20 30 40 43 55
4) Let H1< H2< H3< H4< H5< H6< H7- - - - - Hk be real numbers representing the coordinates of k
towns located along a straight highway. A hospital needs to be built in one of these towns.
a. Design an efficient algorithm to find the hospital location that minimizes the average distance
between the towns and the hospital.
b. Design an efficient algorithm to find the hospital location that minimizes the maximum distance
from a town to the hospital.
5) Determine the number of character comparisons made by the brute-force algorithm in searching
for the pattern ETHOD in the text
SORTING_ALGORITHM_CAN_USE_BRUTE_FORCE_METHOD
Important Instructions: