Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What does BFS stand for?
Think about how the search explores the graph.
How do we keep track of vertices that have been visited in BFS?
Consider whether we need to revisit vertices.
What is the main advantage of using a queue in BFS?
Think about how BFS needs to manage the order of exploration.
The time complexity of BFS using an adjacency matrix is?
Consider how many entries are in the matrix for n vertices.
Given the following graph composed of vertices and edges, write a BFS algorithm that starts with vertex 1 and outputs the order of vertices visited.
Consider how neighbors are added to the queue.
Design a graph with 10 vertices and at least 8 edges such that BFS starting from vertex 1 visits vertices in the order of 1, 2, 3, 4, 5, .... Write what this order reveals about the graph's structure.
Visualize how each vertex connects and ensures every next vertex is reached during exploration.
6 more questions in this section. Enroll free to practise them all.
Enroll free