Stanford公开课之算法:设计与分析——(第四周) Programming Question-4

本博客主要介绍了斯坦福大学公开课中关于算法设计与分析的一个编程问题,任务是针对一个含有875714个节点的有向图,实现算法以计算其最大的5个强连通分量(SCCs)的大小。输出格式要求按降序列出这些大小,如果少于5个,则剩余部分用0填充。由于图的规模,挑战在于内存管理,建议在讨论论坛交流解决策略。该问题涉及到广度优先搜索(BFS)和深度优先搜索(DFS)的实现。
摘要由CSDN通过智能技术生成

Question 1

Download the text file  here. Zipped version  here. (Right click and save link as)

The file contains the edges of a directed graph. Vertices are labeled as positive integers from 1 to 875714. Every row indicates an edge, the vertex label in first column is the tail and the vertex label in second column is the head (recall the graph is directed, and the edges are directed from the first column vertex to the second column vertex). So for example, the 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值