Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 2. How To Graduate As Soon As Possible (a) Given a DAG representing cour

ID: 3719538 • Letter: P

Question

Problem 2. How To Graduate As Soon As Possible (a) Given a DAG representing course pre-requisites, use precise English to describe an algorithm for computing the minimum number of academic terms that it would take to complete all the courses. Assume that there is no limit on how many courses you can take in any given term and that every course is offered every term. b) Explain how to extend your algorithm slightly to produce a course schedule such that all courses are taken in the minimum number of academic terms. (c) What is the asymptotic running time of your algorithm in terms of |V and |El?

Explanation / Answer

Solution:

a)

The algorithm will be selecting the courses in such a way that the courses are selected with minimum time required for the term along with that the property of pre-requisites also needs to be satisfied.

b)

The Algorithm:

c)

The running time of the algorithm will be O(V+E) time.


I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote