Question Paper Midterm Algorithm PDF
Question Paper Midterm Algorithm PDF
Question Paper Midterm Algorithm PDF
Suppose, you are given a character array (called “Full_Name”) which contains your full name. The array
size is 10 and you have to fill up the array using values from your name as follows.
For example, let’s assume your full name is “AMINUL HAQUE” (All Capital) and fill up the
array without any space up to the last index.
Example: AMINUL HAQUE (All Capital)
Page 1 of 2
Index 0 1 2 3 4 5 6 7 8 9
No.
Value A M I N U L H A Q U
Now write your Full Name in all Capital Characters and fill up this “Full_Name” array and write in your
answer script before attempt to answering the following questions.
(a) [Marks: 05] Show the steps for sorting the array using “Quick Sort”. You have to show a
simulation for each iteration step while sorting in alphabetical order.
(b) [Marks: 05] In your sorted array, if you want to search an element from it, then which searching
algorithm you will use here and why. Show steps for searching “Q” in the array.
.
As you may be aware of that during our last DIU ICT Carnival of Daffodil International University, there
was a huge gathering, and like other years, on that day, we face some difficulties while traveling to the
Ashulia campus and also during return from the campus. Though the authority tries to provide sufficient
number of buses, there is always a wastage of bus seats, so many students, later suffer of not getting any
seats. For this year, due to the pandemic, unfortunately we have missed this occasion. However, this year,
we want to make a solution of this problem so in the future we can accommodate more students to their
seats.
Now, would you look at the following figures and provide reasonable solutions using suitable algorithms:
Every bus capacity: 12
Total number of groups: 4
Group sizes will be the addition of “3” with your individual digit of last four digits of your student ID.
For example: if your id is “191-15-2343” then your respective four group sizes will be:
Group 01 size: 2+3=5
Group 02 size: 3+3=6
Group 03 size: 4+3=7
Group 04 size: 3+3=6
Now, using your own student ID, at first, calculate the group sizes for your own. Then find out the
minimum number of the micro-buses for the occasion with your calculated own group sizes:
i. [marks:03] the total number of micro-bus using First-fit algorithm.
ii. [marks:03] the total number of micro-bus using First-fit decreasing algorithm.
iii. [marks:03] the total number of micro-bus using Full-bin packing algorithm.
iv. [marks:01] based on your solutions of 1, 2, and 3, suggest the best algorithm with proper reason.
----The End---
Page 2 of 2