Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

kruscal求最小生成树的最大边

Posted by liushuixingyun at 2011-05-17 10:42:30 on Problem 2395
用快排加并查集实现。用快排实现将所有边递增,在排序的基础上每次对当前的边判断是否与前边的边构成回路,这可以用并查集实现,若当前边的两个端点不在同一集合,则可以将之加入。最终第n-1条边即为本题所求。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator