Unit 4 Quiz Flashcards

(33 cards)

1
Q

Graph

A

set of vertices and set of edges that relate to the vertices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Path

A

how to get from one point to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Weighted Graph

A

Graph with “cost” associated with the travel from one vertex to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Directed Graph

A

Also called Digraph; a graph where each vertex has a one-way relationship represented with arrows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cyclic Graph

A

a graph that contains at least one cycle in it, meaning you can travel back to a vertex.
“All roads lead home”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Acyclic Graph

A

no cycles allowed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Biconnected Graph

A

Graph with no articulation points ( vertices whose removal disconnects the graph )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Topological Sort

A

Printing of vertices ( nodes ) from graph so that if there is a path from Vi to Vj, then Vj appears after Vi. In other words, no prerequisites are violated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Topological sort has __________ and does not need to be _________

A

multiple answers ; truly sorted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Trees are always ________

A

Acyclic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

All trees are _______

A

graphs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Multilist

A

linked list of linked lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

adjacency list

A

1d array of pointers to whoever we connect to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Min spanning tree

A

Tree with minimum number of paths to connect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When does dijkstras fail?

A

when there is a negative weight

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Dijkstras is a ______

A

connected graph

17
Q

dijkstras runtime

A

O ( E log V ) B, A, W
E = # edges
V = # vertices

18
Q

Topological Sort runtime

A

O ( E + V )
E = # edges
V = # vertices

19
Q

Depth and breadth first search runtime

A

O ( E + V )
E = # edges
V = # vertices

20
Q

Breadth first search

A

setup identical to DFS, but use a queue
Prints row by row left to right

21
Q

Depth first search

A

basically a preorder traversal in disguise
1) push start vertex onto stack
2) pop stack, output top vertex, mark it, push all adj non marked vertices.

22
Q

Euler circuit

A

Identical to Hamiltonian circuit, except we want to visit every edge once
- if every vertex has an even degree => euler circuit

23
Q

Circuit

A

special type of cycle on a connected, undirected graph

24
Q

Hamiltonian Circuit

A

circuit with a path that visits every vertex exactly once and returns to the starting point

25
Upper bound
the best weve been able to do so far
26
Lower bound
The best we can hope to do that is theoretically possible
27
Is there a solution to the Euler bridge problem? why?
No because you have to get off the island.
28
example of NP complete problem
travelling salesman problem , four color problem
29
tractable problems
upper and lower bounds are polynomials
30
NP complete problems
upper bound suggests intractable, but lower bound suggests tractable
31
Intractable problems
upper and lower bounds are non-polynomial
32
Undecidable problems
"impossible" to solve
33
What is the halting problem?
trying to figure out if the program is going to run forever or not