Data Structure Multiple Choice Questions on “Assembly Line Scheduling”.
1. Which of the following methods can be used to solve the assembly line scheduling problem?
a) Recursion
b) Brute force
c) Dynamic programming
d) All of the mentioned
Answer: d
Clarification: All of the above mentioned methods can be used to solve the assembly line scheduling problem.
2. What is the time complexity of the brute force algorithm used to solve the assembly line scheduling problem?
a) O(1)
b) O(n)
c) O(n2)
d) O(2n)
Answer: d
Clarification: In the brute force algorithm, all the possible ways are calculated which are of the order of 2n.
3. In the dynamic programming implementation of the assembly line scheduling problem, how many lookup tables are required?
a) 0
b) 1
c) 2
d) 3
Answer: c
Clarification: In the dynamic programming implementation of the assembly line scheduling problem, 2 lookup tables are required one for storing the minimum time and the other for storing the assembly line number.
4. Consider the following assembly line problem:
time_to_reach[2][3] = {{17, 2, 7}, {19, 4, 9}} time_spent[2][4] = {{6, 5, 15, 7}, {5, 10, 11, 4}} entry_time[2] = {8, 10} exit_time[2] = {10, 7} num_of_stations = 4
For the optimal solution which should be the starting assembly line? Answer: b 5. Consider the following assembly line problem: For the optimal solution, which should be the exit assembly line? Answer: b 6. Consider the following assembly line problem: What is the minimum time required to build the car chassis? Answer: d 7. Consider the following code: Which of the following lines should be inserted to complete the above code? Answer: a 8. What is the time complexity of the above dynamic programming implementation of the assembly line scheduling problem? 9. What is the space complexity of the above dynamic programming implementation of the assembly line scheduling problem? 10. What is the output of the following code? a) 32 Answer: c 11. What is the value stored in t1[2] when the following code is executed? a) 16 12. What is the value stored in t2[3] when the following code is executed? a) 19 Answer: c 13. What is the output of the following code? a) 62 Answer: d
a) Line 1
b) Line 2
c) All of the mentioned
d) None of the mentioned
Clarification: For the optimal solution, the starting assembly line is line 2.time_to_reach[2][3] = {{17, 2, 7}, {19, 4, 9}}
time_spent[2][4] = {{6, 5, 15, 7}, {5, 10, 11, 4}}
entry_time[2] = {8, 10}
exit_time[2] = {10, 7}
num_of_stations = 4
a) Line 1
b) Line 2
c) All of the mentioned
d) None of the mentioned
Clarification: For the optimal solution, the exit assembly line is line 2.time_to_reach[2][3] = {{17, 2, 7}, {19, 4, 9}}
time_spent[2][4] = {{6, 5, 15, 7}, {5, 10, 11, 4}}
entry_time[2] = {8, 10}
exit_time[2] = {10, 7}
num_of_stations = 4
a) 40
b) 41
c) 42
d) 43
View Answer
Clarification: The minimum time required is 43.
The path is S2,1 -> S1,2 -> S2,3 -> S2,4, where Si,j : i = line number, j = station number #include
a) t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+reach[0][i-1]+spent[1][i])
b) t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+spent[1][i])
c) t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+reach[0][i-1])
d) none of the mentioned
Clarification: The line t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+reach[0][i-1]+spent[1][i]) should be added to complete the above code.
a) O(1)
b) O(n)
c) O(n2)
d) O(n3)
Answer: b
Clarification: The time complexity of the above dynamic programming implementation of the assembly line scheduling problem is O(n).
a) O(1)
b) O(n)
c) O(n2)
d) O(n3)
Answer: b
Clarification: The space complexity of the above dynamic programming implementation of the assembly line scheduling problem is O(n).#include
b) 33
c) 34
d) 35
Clarification: The program prints the optimal time required to build the car chassis, which is 34.#include
b) 18
c) 20
d) 22
Answer: c
Clarification: The value stored in t1[2] when the above code is executed is 20.#include
b) 23
c) 25
d) 27
Clarification: The value stored in t2[3] when the above code is executed is 25.#include
b) 69
c) 75
d) 88
Clarification: The program prints the optimal time required to build the car chassis, which is 88.