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

F2024 AOA Assignment 4 (Greedy Algorithm, Dynamic Programming)

This document outlines Assignment No. 4 for the Analysis of Algorithms course at the University of Management and Technology, due on February 12, 2025, and worth 50 marks. It includes instructions for submission, guidelines on plagiarism, and specific algorithm-related questions such as finding shortest paths using Kruskal, Prim, and Dijkstra algorithms, as well as solving knapsack problems and performing Huffman encoding. Students are advised to start early and keep all files for evaluation purposes.

Uploaded by

areebababar1612
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 views4 pages

F2024 AOA Assignment 4 (Greedy Algorithm, Dynamic Programming)

This document outlines Assignment No. 4 for the Analysis of Algorithms course at the University of Management and Technology, due on February 12, 2025, and worth 50 marks. It includes instructions for submission, guidelines on plagiarism, and specific algorithm-related questions such as finding shortest paths using Kruskal, Prim, and Dijkstra algorithms, as well as solving knapsack problems and performing Huffman encoding. Students are advised to start early and keep all files for evaluation purposes.

Uploaded by

areebababar1612
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/ 4

University of Management

And Technology

Analysis of Algorithms
Assignment No: 4 Instructor: Mr. Mian Ahmed Shafiq
Session: Fall 2024 Due Date: 12th February, 2025
Section: Total marks: 50

Question CLO Domian/BT Level Total Marks

1 4 C4 50

Advice and Submission Guidelines for Assignment

• Make sure that you read and understand each and every instruction. If you have any
questions or comments you are encouraged to discuss (only) with your colleagues and
instructor.
• In case of hand written assignment, take pictures and convert them into PDF format.
Upload PDF file on the LMS and submit the hand written form to class teacher.
• All the submitted evaluation instruments (quizzes, assignments, class work, exams, and the
project) will be checked for plagiarism.
• Later Submission and Plagiarism will be dealt as per university Policy
• Start early otherwise you will struggle with the assignment.

Note: Keep all your files. It will be required at any time of evaluation.

1
University of Management
And Technology
Question 1 [CLO 4] [25]
i. Find the shortest path through Kruskal, Prims and Dijkstra algorithm.

ii. Find the shortest path through Kruskal, Prims and Dijkstra algorithm.

iii. Solve the following using fractional knapsack algorithm and 0/1 knapsack algorithm.

a) You are given a set of items, each with a weight and a value. You have a knapsack with
a limited capacity. Your goal is to determine which items to include in the knapsack to
maximize the total value without exceeding the knapsack's capacity.
Knapsack capacity: 7
Item Weight Value
1 2 3
2 3 4
3 4 5

2
University of Management
And Technology
b) You are a treasure hunter who has stumbled upon a hidden cave filled with valuable
artifacts. However, your backpack has a limited weight capacity. You must choose
which artifacts to take to maximize their total value while staying within the weight
limit of your backpack.
Knapsack capacity: 10 kg

Artifact Weight (kg) Value ($)


1 (Gold Coin) 1 50
2 (Silver Statue) 3 100
3 (Diamond Necklace) 2 150
4 (Jade Figurine) 4 120
5 (Ancient Scroll) 1 80
6 (Ruby Ring) 2 70
7 (Carved Ivory Tusk) 5 200
8 (Bronze Sword) 3 90

iv. Solve the following by Chain Matrix Multiplication.

a) Consider the following sequence of matrices:


• A1: 10x30 matrix
• A2: 30x5 matrix
• A3: 5x60 matrix

b) Consider the following sequence of matrices:


• A1: 20x30
• A2: 30x10
• A3: 10x5
• A4: 5x25

c) Consider the following sequence of matrices:


• A1: 10x20
• A2: 20x5
• A3: 5x30
• A4: 30x15
• A5: 15x25

3
University of Management
And Technology
v. Solve the following by Huffman Encoding.

Character Frequency
a' 5
b' 9
c' 12
d' 13
e' 16
f' 45

Instructions:
i. Hard copy of assignment is required (Hand Written).
ii. Also submit the soft copy on LMS.
iii. Due Date is 12th February, 2025 Wednesday in office.

You might also like