[关闭]
@w1024020103 2017-05-07T09:47:03.000000Z 字数 613 阅读 701

Lecture 26: Graphs

CS61B


Intro

Graph Types

1.JPG-46.8kB

Graph Terminology

2.JPG-88.7kB

Graph Example

3.JPG-59.2kB

Graph Representation

Graph API

4.JPG-77.4kB

Graph Representation 1 : Adjacency Matrix

5.JPG-63.1kB

Order of growth of Runtime:

6.JPG-82.2kB

G.adj(i)returns a Iterable(like a set, list etc)

7.JPG-80.6kB

Graph representation 2: edge set (trivial)

8.JPG-44.9kB

9.JPG-49.3kB

runtime analysis:

10.JPG-80.9kB

11.JPG-75.5kB

12.JPG-72.4kB

Summary:

13.JPG-78.7kB

implementation:

14.JPG-69.5kB

Depth-First Traversal

Recursive method to check if s is connected to t:

15.JPG-57.9kB

16.JPG-54.4kB

17.JPG-55kB

18.JPG-62kB

Depth-first traversal definition:

19.JPG-48.3kB

good example for Depth-first Traversal:

20.JPG-79.7kB

Depth First Search Implementation

21.JPG-89.1kB
22.JPG-74kB
23.JPG-82.5kB

Graphs Intro Study Guide

B LEVEL:

1.
25.jpg-9.3kB

if we count .adj() as our cost model, runtime is Θ(V);
if we count .print(), runtime is Θ(E);

11.JPG-75.5kB

2.
image_1bfg7stdp3ec1u611sp6q9h1mvj11.png-7.6kB

注意一下啥叫tightest bound.

25.jpg-101.8kB

3.27.JPG-24.1kB

3题和A LEVEL都不会

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