Question
Suppose that youre ready to declare a new major, and your advisor asks you design a course plan. They give you a representation of the
Suppose that youre ready to declare a new major, and your advisor asks you design a course plan. They give you a representation of the departments courses as a DAG, where vertices are courses and edges represent prerequisites. Your task is to decide which courses you want to take, and in what order. Design an algorithm that takes as input the prerequisite DAG along with a proposed set of courses to complete the major, and determines whether there is an order in which those courses can be taken such that all prerequisites will always be satisfied. If such an order exists, you should return it; otherwise return fail.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started