0% found this document useful (0 votes)
6 views2 pages

Assignment I G11934 20251

This document outlines an assignment for the Design & Analysis of Algorithms course at Jazan University for the academic year 2024-25. It includes various algorithmic problems related to LCM calculation, matrix symmetry checks, sorting algorithms, assignment problems, and hospital location optimization. The assignment is due on March 6, 2025, and includes specific submission guidelines and penalties for late submissions.

Uploaded by

ahmed4mak42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Assignment I G11934 20251

This document outlines an assignment for the Design & Analysis of Algorithms course at Jazan University for the academic year 2024-25. It includes various algorithmic problems related to LCM calculation, matrix symmetry checks, sorting algorithms, assignment problems, and hospital location optimization. The assignment is due on March 6, 2025, and includes specific submission guidelines and penalties for late submissions.

Uploaded by

ahmed4mak42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

KINGDOM OF SAUDI ARABIA | JAZAN UNIVERSITY

COLLEGE OF ENGINEERING & COMPUTER SCIENCE


ASSIGNMENT I – 2024-25
Academic Year 2024-25 Semester Second
Course with code Design & Analysis of Algorithms (COMP322) Section 11934
Type of Assignment Individual Marks 10
Date of Announcement 04.02.2025 Deadline 06.03.2025

ASSIGNMENT PROBLEM STATEMENT

ANSWER ALL QUESTIONS:

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

2a) Consider the following Non-recursive Algorithm:

ALGORITHM SkewSymmetryCheck (A [0..n−1, 0..n−1]


// Input: A matrix A[0..n−1, 0..n−1] of real numbers
for i ← 0 to n − 2 do
for j ← i + 1 to n − 1 do
if A[i, j] ≠ -A[j, i] then
return false
for i ← 0 to n − 1 do
if A[i, i] ≠ 0 then
return false
return true

a) What does this algorithm compute?


b) What is its basic operation?
c) How many times is the basic operation executed?
d) What is the efficiency class of this algorithm?

2b) Consider the following Recursive Algorithm:


ALGORITHM S(n)
//Input: A positive integer n
if n = 1 return 1
else return S(n − 1) + n ∗ n ∗ n ∗ n
a) Set up and solve a recurrence relation for the number of times the algorithm’s basic operation
is executed.
b) How does this algorithm compare How does this algorithm compare with the straightforward
non-recursive algorithm for computing this sum?
3a) Sort the list A, H, E, M, D, A, B, A, D in alphabetical order by Selection sort and Insertion sort.

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:

• Submit the soft copy(pdf) of your assignment on Blackboard.


• Handwritten Assignment is not allowed.
• Make the Assignment Name like this (your ID. Assignment_1)
• Take proper care during submission of Assignment; submit it in proper group and proper
document. After the submission kindly check the document again. If you have submitted the
wrong document or in a wrong group, immediately contact me to me (Course Teacher).(via
WhatsApp)
• Submit the Assignment soft copy BEFORE 23:59hrs of the due date.
• If you submit your assignment late. Each day, 10% penalty will incur of the total marks scored
by the students.

Name of the Course Teacher Mr. Aasif Aftab Signature

You might also like