Graphs cs320

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:05 AM on 4/23/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

27 Terms

1
New cards

What is an undirected graph?

A graph where edges do not have direction; each edge (u, v) is bidirectional.

2
New cards

What is a directed graph?

A graph where each edge (u, v) has a direction, from u to v.

3
New cards

What are nodes and edges?

Nodes (vertices) are the entities in the graph; edges represent connections between nodes.

4
New cards

What are n and m in a graph?

n = number of nodes; m = number of edges.

5
New cards

What is an adjacency matrix?

An n x n matrix where A[u][v] = 1 if there is an edge from u to v.

6
New cards

What is an adjacency list?

An array of lists, where each index stores the neighbors of a node.

7
New cards

Which graph representation is more space-efficient?

Adjacency list, especially for sparse graphs.

8
New cards

What is a path in a graph?

A sequence of nodes where each consecutive pair is connected by an edge.

9
New cards

What is a cycle in a graph?

A path where the first and last nodes are the same, and all other nodes are distinct.

10
New cards

What is a connected graph?

A graph where there is a path between every pair of nodes.

11
New cards

What is a tree in graph theory?

A connected undirected graph with no cycles.

12
New cards

How many edges does a tree with n nodes have?

n - 1

13
New cards

What is breadth-first search (BFS)?

A traversal method that explores neighbors layer by layer using a queue.

14
New cards

What is depth-first search (DFS)?

A traversal method that explores deeply along branches before backtracking, usually with a stack.

15
New cards

What is the time complexity of BFS or DFS (adjacency list)?

O(m + n)

16
New cards

What is a connected component?

A set of nodes such that each is reachable from the others.

17
New cards

How to find all connected components in a graph?

Repeatedly run BFS or DFS on unvisited nodes.

18
New cards

What is a bipartite graph?

A graph that can be 2-colored such that no edge connects same-colored nodes.

19
New cards

What prevents a graph from being bipartite?

An odd-length cycle.

20
New cards

What is a strongly connected directed graph?

Every node is reachable from every other node.

21
New cards

How to test strong connectivity?

Run BFS from a node in both original and reversed graph. If all nodes are reached, it's strongly connected.

22
New cards

What is a DAG?

A directed acyclic graph—contains no directed cycles.

23
New cards

What is topological ordering?

An ordering of nodes where each directed edge (u, v) has u before v.

24
New cards

Does every DAG have a topological ordering?

Yes.

25
New cards

What is a source in a DAG?

A node with no incoming edges.

26
New cards

What is a sink in a DAG?

A node with no outgoing edges.

27
New cards

What is the time complexity of topological sorting via in-degrees?

O(m + n)

Explore top notes

note
🦅 APUSH Unit 5 Notes
Updated 190d ago
0.0(0)
note
Memrise beginner/TTMIK level one
Updated 1297d ago
0.0(0)
note
Metals 12.1 to 12.4
Updated 1326d ago
0.0(0)
note
Apwh guide
Updated 706d ago
0.0(0)
note
Chapters 5.1 and 5.2 Populations >
Updated 1061d ago
0.0(0)
note
Chapter 16: The Judiciary
Updated 1041d ago
0.0(0)
note
Physical Science - Chapter 19
Updated 1038d ago
0.0(0)
note
🦅 APUSH Unit 5 Notes
Updated 190d ago
0.0(0)
note
Memrise beginner/TTMIK level one
Updated 1297d ago
0.0(0)
note
Metals 12.1 to 12.4
Updated 1326d ago
0.0(0)
note
Apwh guide
Updated 706d ago
0.0(0)
note
Chapters 5.1 and 5.2 Populations >
Updated 1061d ago
0.0(0)
note
Chapter 16: The Judiciary
Updated 1041d ago
0.0(0)
note
Physical Science - Chapter 19
Updated 1038d ago
0.0(0)

Explore top flashcards

flashcards
Prof Comm 25/26
66
Updated 248d ago
0.0(0)
flashcards
tema 4 vocabulario
51
Updated 81d ago
0.0(0)
flashcards
520 intro & cns cells
59
Updated 932d ago
0.0(0)
flashcards
Bio Chapter 12
22
Updated 1055d ago
0.0(0)
flashcards
Religion chapter 11 test
47
Updated 1173d ago
0.0(0)
flashcards
Prof Comm 25/26
66
Updated 248d ago
0.0(0)
flashcards
tema 4 vocabulario
51
Updated 81d ago
0.0(0)
flashcards
520 intro & cns cells
59
Updated 932d ago
0.0(0)
flashcards
Bio Chapter 12
22
Updated 1055d ago
0.0(0)
flashcards
Religion chapter 11 test
47
Updated 1173d ago
0.0(0)