ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!


    Question

    The first step in the greedy Activity Selection problem

    is to sort the activities. Which criterion is used for sorting to ensure the greedy choice property holds?
    A Sort by increasing order of start times. Correct Answer Incorrect Answer
    B Sort by decreasing order of finish times. Correct Answer Incorrect Answer
    C Sort by increasing order of activity durations. Correct Answer Incorrect Answer
    D Sort by increasing order of finish times. Correct Answer Incorrect Answer
    E Sort by decreasing order of start times. Correct Answer Incorrect Answer

    Solution

    тАв Concept: The Activity Selection Problem is a classic greedy algorithm problem where the goal is to select the maximum number of non-overlapping activities from a given set. тАв Explanation of Correct Answer (D): Sort by increasing order of finish times. o The greedy strategy for the Activity Selection Problem is to always pick the activity that finishes earliest among the remaining compatible activities. To implement this efficiently, the activities are first sorted by their finish times in ascending order. This allows the algorithm to iterate through the sorted activities and pick the first one that doesn't overlap with the previously selected activity, guaranteeing an optimal solution.

    Practice Next
    More IT Operating System Questions
    ask-question