• Tidak ada hasil yang ditemukan

Department of Computer Science and Engineering

N/A
N/A
Protected

Academic year: 2023

Membagikan "Department of Computer Science and Engineering"

Copied!
3
0
0

Teks penuh

(1)

Daffodil International University

Department of Computer Science and Engineering

Faculty of Science & Information Technology

Midterm Examination, Summer 2020 @ DIU Blended Learning Center Course Code: CSE214 (Day), Course Title: Algorithm

Level: 2 Term: 1 Section: PC-C

Instructor: Saif Mahmud Parvez Modality: Open Book Exam Date: Thursday, August 27, 2020 Time: 09:00am-01:00pm

Four hours (4:00) to support online open/case study based assessment Marks: 40 Directions:

Students need to go through the CASE STUDY shown in this exam paper.

Analyze and answer specific section based on your own thinking and work.

Do not share as this will be treated as plagiarism by Blended Learning Center.

Marks Part A

Suppose you are given a character array which is named as “FullName”. Array size is 10 and you have to fill up the values in following the example given below. For example, let’s assume your full name is“SAIF MAHMUD” (All Capital) and fill up the name array without any space up to the last index. Example: SAIFMAHMUD(All Capital)

Index 0 1 2 3 4 5 6 7 8 9

Value S A I F M A H M U D

Now Write your Full Name in all Capital Characters and fill up this “FullName” array and write in your answer script before answering below questions. Your Algorithm must be modified using this

“FullName” Array.

1. Write a Modified Merge Sort Algorithm and Sort the following “Full Name” Array using Your Algorithm. You have to show a simulation for each iteration step [Iteration = When the value of the array is swapped considering the condition is met].

6

Assume a name of your best friend. For my case, it is my best friend “SAGOR”. Put your best friend name in an character array named “BFFName”. (For example, BFFName = “SAGOR”. Now answer the following two questions.

2. You have to find the similarity between your full name and your best friend name.

Show every step of your simulation and and show the similarity portion. 7 3. From your answer in (2), calculate the similarity percentage of your full name and

your best friend name. 2

(2)

Part B

Writeyour last five digits of your student id. Then calculate the following equation for every digit:

For example: if your last five digits are: “12232”, then for note calculation:

i. Value 1: (1 mod 5) +1=2 ii. Value 2: (2 mod 5) +2=4 iii. Value 3: (2 mod 5) +3=5 iv. Value 4: (3 mod 5) +4=7 v. Value 5: (2 mod 5) +5=7

So, these are the values of 5 items. Add 3 to each of them to get the weight of each item. So the final value and weight of these 5 items will be like below.

Item Value Weight

1 2 5

2 4 7

3 5 8

4 7 10

5 7 10

Assume the total weight of your sack is 15.

4. Calculate your own value weight and find the maximum value you can get by

filling the sack usingDP. (Assume items are indivisible) 4 5. If items are divisible (or fractional), find the maximum value you can get using

Greedy Approach. 4

6. Compare the two result from DP and Greedy. 2

Part C

Write your five most favorite area names[from 1 km to your home, not exceed 1km]. Now using these five points drawdirected and weighted (weight is num of time in min to go one point to another point) graph. Here putall possible ways as edges in the graph. Make sure no way (that’s edge) is excluded by yourself.

7. Now you want to make a robot for travelling these five points sequentially and automatically. For this reason, first select an algorithm that you have learned by CSE214 course. Then, simulate your algorithm on your graph and show all steps one by one. And finally write the sequence of the location points from your answer.

5

8. After visiting the location by your robot report the paths that he/she visited. Then you get a details idea on the location that you have not before. So, from that inspiration you want to make sure that you will cover all these five areas in your personal network from your home. But problem is your budget, as you are a student you have a limited budget to do so. But you know very efficientand effective algorithm that you have learned from this course. So, from your knowledge based on the learning from CSE214, select an appropriate one algorithm. Now with your selected algorithm show the steps and finally show the total cost for your own graph.

5

9. Now this part is challenging for you, find a single source shortest path algorithm from your home [on your graph] using your own modified algorithm [you cannot use the exact graph algorithm from CSE214 course, but you can do modification and use]. Show the steps of your simulation and find out the single source shortest algorithm. Also write the modification or change or exception of your developed algorithm.{Instruction: No two algorithms or concepts is acceptable, so think, develop and write your own algorithm for this question}

5

(3)

Referensi

Dokumen terkait

You can also enter a further full-text search term within your initial set of results to refine your search.. You can drill down further on your search results to find exactly what

season or play-off games Just present your student ID at the Union Student Services Office and you will receive a discount form for use when you buy your SCIENCE SCHOOL HAS WEEKLY