coursera 错题集
来源:互联网 发布:九型人格出生日期算法 编辑:程序博客网 时间:2024/06/06 18:58
Question 2
(seed = 256010)Consider the adjacency-lists representation of a DAG with 8 vertices and 13 edges: A: B E B: G C C: D D: E: B F: G B E G: H C H: D C Here is a graphical representation of the same DAG: (A)------------>(B)------------>(C)------------>(D) | ^^\ ^^ ^ | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | | / | \ | \ | v/ | v| \| (E)<------------(F)------------>(G)------------>(H)Give the topological order of the vertices that results from the DFS-basedtopological sort algorithm. As usual, perform the first DFS from vertex A.Your answer should be a sequence of 8 uppercase letters
You entered:
Question Explanation
The correct answer is: F A E B G H C DHere is a trace of the depth-first search:dfs(A) dfs(B) dfs(G) dfs(H) dfs(D) D done dfs(C) check D C done H done check C G done check C B done dfs(E) check B E doneA donecheck Bcheck Ccheck Dcheck Edfs(F) check G check B check EF donecheck Gcheck HThe postorder is the order in which the vertices are done. The reverse postorderprovides a topological order.
(seed = 521570)Consider the adjacency-lists representation of a digraph G with 10 vertices and 17 edges: A: G B: A H C: D B H I D: I E: J D F: A G: B F H: G I: H E J: I Here is a graphical representation of the same digraph G: (A)<------------(B)<------------(C)------------>(D)<------------(E) ^\ ^\ |\ | ^| | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | \ | \ | \ | / | | v| vv vv/ v (F)<------------(G)<------------(H)<------------(I)<------------(J)Compute the strongly-connected components of the digraph using the Kosaraju-Sharir algorithm.Assume that the first depth-first search of Kosaraju-Sharir computes the reverse postorder of G^R: A F G H B I D C J E Give the sequence of the 10 integers in the id[] array for the vertices A through J. v A B C D E F G H I J ------------------------------------ id[v]You entered:Your Answer Score Explanation 0 0 1 1 1 0 0 1 1Incorrect0.00 Total 0.00 / 1.00Question ExplanationThe correct answer is: 0 0 2 1 1 0 0 0 1 1 v A B C D E F G H I J ------------------------------------id[v] 0 0 2 1 1 0 0 0 1 1 The second depth-first search considers the vertices in the following order: A F G H B I D C J E Here is a trace of the second depth-first search:strong component 0------------------dfs(A) dfs(G) dfs(B) check A dfs(H) check G H done B done dfs(F) check A F done G doneA done------------------check Fcheck Gcheck Hcheck Bstrong component 1------------------dfs(I) check H dfs(E) dfs(J) check I J done dfs(D) check I D done E doneI done------------------check Dstrong component 2------------------dfs(C) check D check B check H check IC done------------------check Jcheck E
0 0
- coursera 错题集
- coursera ML 错题集
- Coursera
- coursera
- Coursera
- coursera 神经网络
- H5 COURSERA
- Coursera Js
- coursera C
- coursera视频
- SaaS Introduction----coursera
- 学习记录(coursera)
- 如何下载coursera视频
- NLP coursera note 1
- coursera-android-week4-4
- coursera week5 notification
- coursera-合并排序
- coursera Machine Learning ex1
- 欢迎使用CSDN-markdown编辑器
- XCode升级后插件失效的原理与修复办法
- 安装ssh并配置免密码登录时遇到的问题
- EXCEL文档没有打开时,报错误"外部表不是预期的格式。"
- linux网络编程手记
- coursera 错题集
- 自定义ProgressDialog,实现超时功能
- 在struts2.0框架中,多struts.xml与多applicationContext.xml配置的方法
- Mac Pro 安装 双系统 window7
- DNS解析协议的C语言简单实现
- Lua游戏脚本热更新机制
- 分布式服务框架远程服务通讯介绍
- 日常:在MAC平台下,有关数据解析,HTML生成Excel档
- Unity3D: StartCoroutine 和 yield return 深入研究