[关闭]
@w1024020103 2017-05-12T10:21:33.000000Z 字数 831 阅读 649

Graph Traversals Study Guide

CS61B


Overview

17.JPG-71.3kB

4.JPG-87.7kB

18.JPG-67.1kB

8.JPG-58.1kB

9.JPG-61.6kB

19.JPG-80.4kB

13.JPG-78.3kB

C LEVEL

3.Problem 2a from Princeton's Fall 2009 final

20.JPG-41.5kB
image_1bfrvtds69o9t1g5qt15vd72339.png-6.7kB
错了 这个得自己enqueue dequeue一下才知道:

image_1bfs23gdv161u1k2r14nsicq1p4r4f.png-63.5kB

5.Problem 1a and 1b from Princeton's Spring 2008 final.
21.jpg-83kB

6.Problem 3a from Princeton's Fall 2010 final.
22.jpg-64.3kB

错,更正:

22.jpg-62.2kB

还是错,再看一遍:

22.jpg-59.9kB

终于对了,说明一点不熟。

B level

1.Problem 2b from Princeton's Fall 2009 final.

image_1bfs3pbqq1npo1hfu2nq142j1e5f6q.png-94.9kB

这道题对英文的理解有问题,所以我建议继续做GRE阅读题呢。
更正:

image_1bft4o6mpq7amsj1a06dhjqh49.png-238.6kB

2.Problem 1c from Princeton's Spring 2008 final.

image_1bfs3oesf1kgn1pg39s4kg0hmu6d.png-20.7kB

3.Problem 3b from Princeton's Fall 2010 final.
image_1bfs4i8rt1l2jism1e6te1fc8d77.png-263.8kB

要理解这里的 simultaneously on function call stack at some point during DFS 是什么意思,我的理解是能够构成一条return DFS的路,那么这条路上的所有vertices就是同时在stack上。
比如A-B-G,A-C-D-F-E.

image_1bft5lurhevqg8qr0q188l4m3m.png-83.3kB

讨论:
DFS Graph

LEVEL A
1.Adapted from Algorithms textbook 4.2.10: Given a DAG, does there exist a topological order that cannot result from applying a DFS-based algorithm, no matter in what order the vertices adjacent to each vertex are chosen? Prove your answer.

https://www.youtube.com/watch?v=Q9PIxaNGnig
Topological Sorting

题目搜了一下,答案都是刷题的人总结的,所以现在不做了,刷题时做。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注