Coding: Course schedule problem java please thanks There are a total of n courses you have to take, labeled from 0 to n

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Coding: Course schedule problem java please thanks There are a total of n courses you have to take, labeled from 0 to n

Post by answerhappygod »

Coding: Course schedule problem
java please thanks
There are a total of n courses you have to take, labeled from 0
to n − 1. You are given an array prerequisites where each element
prerequisites = [ci, cj ] indicates that you must take course cj
first if you want to take course ci. For example, the pair [0, 1],
indicates that to take course 0 you have to first take course 1.
Your task is write a function that takes the number of courses
n, and prerequisites array as parameter, return the ordering of
courses you should take to finish all courses. If there are many
valid answers, return any of them. If it is impossible to finish all
courses, return an empty array.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply