GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — LeetCode/BFS/1462.Course-Schedule-IV at master · wisdompeak/LeetCode

Expand file tree

/

1462.Course-Schedule-IV

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

1462.Course-Schedule-IV

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
1462.Course-Schedule-IV.cpp
1462.Course-Schedule-IV.cpp
 
 
Readme.md
Readme.md
 
 

Readme.md

1462.Course-Schedule-IV

考虑到n<=100,即使将每个节点的所有先修课程都记录下来,时间复杂度o(n^2)也是可以接受的。于是本题就是常规的拓扑排序算法,需要特别处理的是:每次从cur拓展到下一个next节点时,要把cur的所有先修课程都复制一遍给next。至于数据结构,显然用集合来实现去重和查询query都很方便。

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.