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.
Coding: Course schedule problem java please thanks There are a total of n courses you have to take, labeled from 0 to n
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am