Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
19.1.1. Graph Basics
This section
Practice test
10 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
4 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is a vertex in a graph?
Hint
Think about what elements make up a graph.
- 2.
Define an undirected edge.
Hint
Consider how you would represent a two-way street in a city.
- 3.
What does an adjacency matrix represent?
- A 1D array
- A list of neighbors
- A 2D array of edges
Hint
Think about how you visualize a grid.
- 4.
True or False: An undirected edge has a direction.
- True
- False
Hint
Consider the meaning of undirected.
- 5.
Construct a graph using an adjacency matrix for five vertices where vertex 1 is connected to vertices 2 and 3, vertex 2 to vertex 4, and vertex 3 to vertex 5. Show your work.
Hint
Remember to mark both directions for undirected edges.
- 6.
Using breadth-first search, describe how you would traverse this constructed graph from vertex 1 to determine all reachable vertices.
Hint
Remember to keep track of the visited vertices and the order you explore.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
Get your answers marked and your progress tracked
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting