首页 > 其他 > 详细

Week1.Interview

时间:2021-02-15 10:08:25      阅读:22      评论:0      收藏:0      [点我收藏+]

Social network connectivity.

Given a social network containing nn members and a log file containing mm timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time at which all members are connected (i.e., every member is a friend of a friend of a friend ... of a friend). Assume that the log file is sorted by timestamp and that friendship is an equivalence relation. The running time of your algorithm should be m \log nmlogn or better and use extra space proportional to nn.

 

Week1.Interview

原文:https://www.cnblogs.com/JasonJ/p/14402928.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!