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

Page 1 of 4

This document provides instructions for a take-home final exam for an algorithms course. It includes 3 questions to be answered in Word format. Question 1 has 4 parts analyzing algorithm time complexities and solving recurrences. Question 2 involves array and tree operations, heapsort, and hashing. Question 3 requires a 1000-1200 word report on an assigned algorithm. Rubrics are provided to guide students and evaluate responses.
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)
73 views4 pages

Page 1 of 4

This document provides instructions for a take-home final exam for an algorithms course. It includes 3 questions to be answered in Word format. Question 1 has 4 parts analyzing algorithm time complexities and solving recurrences. Question 2 involves array and tree operations, heapsort, and hashing. Question 3 requires a 1000-1200 word report on an assigned algorithm. Rubrics are provided to guide students and evaluate responses.
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

Page 1 of 4

Final Exam (Take-Home) Spring - 2020

Subject: D&A of Algorithms Submission Day: Wednesday


Instructor: Mehak Usmani Submission Date & Time: 10th June, 12:00 pm
Program: BS (CS) Max. Marks: 40

Department of Engineering, Sciences & Technology

Please follow the instructions carefully:


1. Write you answers in a Word file and upload the file before the due date on VLE.
2. Name your Word file in the following format:
(StudentID_Student’sName_CourseName_Instructor’sName_ Spring2020)
3. Use 12 pt. font size and Times New Roman font style along with 1-inch page margins.
4. Follow the requirements of the word limit and the marking criteria while writing your answers.
5. Provide relevant, original and conceptual answers, as this exam aims to test your ability to examine,
explain, modify or develop concepts discussed during the course.
6. Do not copy answers from the internet or other sources. The plagiarism of your answers will be checked
through Turnitin software.
7. Recheck your answers before the submission on VLE to correct any content or language related errors.

Instructor’s Signature
Page 2 of 4

Question No 01: [15 Marks]


a) Divide and conquer is an algorithm design paradigm based on multi-branched recursion. Explain. (2)

b) What is the smallest value of n such that an algorithm whose running time is 100∗ 𝑛2 runs faster than an
algorithm whose running time is 2𝑛 on the same machine? (2)

c) Find the solution using substitution method. (4)


𝑛 𝑛
𝑇(𝑛) = 𝑇 (3 ) + 𝑇 (3 ) + (𝑛3)

d) For the following recurrence relation,


𝑛
𝑇(𝑛) = 6𝑇 (3 ) + (𝑛2 )

i. Prove that function (n lg n) does not hold as the upper bound. (2)

ii. Find the solution using Master Method. (2)

iii. Find solution using recurrence tree method. (3)

Question No 02: [20 Marks]


a) Consider an Array of your complete registration number like the one given below and do the following

0 2 1 1 5 6 5 3 9 4

i. Create a tree using Array indices. Given the index i of a node, the indices of its parent, left child, and right
child can be computed. (1)

ii. Convert this tree to Max Heap using BUILD_MAX_HEAP procedure as discussed in class. (2)

iii. Apply HEAPSORT procedure on Max Heap built in part (ii) to perform sorting (2)

b) Consider the list of student registration numbers that needs to be mapped in a hash table using double hashing.
Generate 7 roll numbers by incrementing 1 in your roll number each time.

For Example; if your roll number is 0211565394, then next 7 numbers with increment of 1 would be 0211565395,
0211565396, 0211565397, 0211565398, 0211565399, 0211565400, 0211565401. Then add these 7 numbers in a
hash table.

The first hash function (h1) must be the following;

ℎ1 (𝑘) = ⌊ 𝑚 (𝑘 𝐴 𝑚𝑜𝑑1)⌋

Choose values for m and A and give reason of your choice. You can use any second hash function (h2) of your
choice. Give each step clearly. (5)
Page 3 of 4

c) Consider a 0-1 knapsack problem where a thief robbing a store finds n items. The ith item is worth vi dollars and
weighs wi pounds, where both are integers. The thief wants to take as valuable a load as possible, but he can carry
at most W pounds in his knapsack, for some integer W. Which items should he take? Consider list of following
items and find optimal list of items using dynamic programming’s tabulation method. (5)

Item vi wi
A 23 5
W=8
B 21 3
C 14 4
D 19 6
E 12 5
F 10 2

d) Consider the following list of activities for ‘Activity Selection Problem’ in which the objective is to complete the
maximum number of activities that are compatible with each other.

i. Suppose that instead of always selecting the first activity to finish, we instead select the last activity to
start that is compatible with all previously selected activities. Describe how this approach is a greedy
algorithm and prove that it yields an optimal solution using following example. (2)

ii. Not just any greedy approach to the activity-selection problem produces a maximum-size set of mutually
compatible activities. Give an example to show that the approach of selecting the activity of least duration
from among those that are compatible with previously selected activities does not work. (3)

Question No 03: [05 Marks]


Give a brief report (of 1000 to 1200 words) on the algorithm that was assigned to you for the presentation in the class.
Your report should include background of problem that algorithm solves, design, implementation example, applications in
research and analysis of the algorithm.

Note: Your content will be checked for plagiarism so avoid copying from internet and write in your own words.

[please turn over for rubrics]


Page 4 of 4

Note:
Students are expected to consider the following rubrics for guidance while attempting this exam. Rubric is a set of criteria
for grading student’s effort and a scoring guide used to evaluate the quality of responses.

Excellent Good Satisfactory Not Satisfactory


Criteria
(88% or above) (Between 74%-87%) (Between 60%-73%) (59% or below)

Concept explanation Concept explanation Concept explanation


Incorrect explanation
Quality of work in extraordinary style in interesting way and is correct but poorly
of concepts
and well organized well organized organized

Correct Identification Correct Identification


Correct Identification Incorrect
Problem and reasonable and but no
and understanding of Identification of the
Understanding understanding of the understanding of the
the problem asked problem asked
problem asked problem asked
Near to correct
Incorrect
Solution Good & efficient Correct implementation of
implementation and/or
Implementation implementation. implementation. solution but not giving
no output.
expected output.
Outstanding analysis Good analysis on Reasonable analysis
Concluding the Poor analysis of
on basis of results basis of results on basis of results
problem results.
achieved. achieved. achieved.

Excellent
understanding of basic Good understanding Good understanding Poor understanding of
Knowledge of
and advanced of basic and advanced of basic concepts of basic concepts of
Course
concepts of course concepts of course. course course
with applications.

You might also like