Skip to main content

4 docs tagged with "Topological Sort"

View All Tags

Course Schedule

For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1. Return true if you can finish all courses. Otherwise, return false.

Course Schedule II

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.

Minimum Height Trees

Among all possible rooted trees, those with minimum height (i.e. min(h)) are called minimum height trees (MHTs).