Consider the following algorithm to find the solution of the activity selection problem. Which of the following option is best suited to fill the blank?
Sort the given activity List
display the first activity
set i = 1
for j = 1 to n-1 do
if begin time of activity[j] >= completion of activity[i] then
___________
i = j
Sort the given activity List
display the first activity
set i = 1
for j = 1 to n-1 do
if begin time of activity[j] >= completion of activity[i] then
___________
i = j
A. display the ith activity
B. display the jth activity
C. discard the activity
D. increment j
Answer: Option B
Join The Discussion