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 an adjacency matrix represent?
Think about how vertices are arranged in a grid.
What is the role of the visited array in BFS?
Consider why we don’t want to revisit vertices.
What does BFS stand for?
Focus on the term 'breadth' when thinking about exploration.
True or False: BFS can be used to find the shortest path in an unweighted graph.
Consider the meaning of 'shortest path' in this context.
Given a graph represented as an adjacency list, outline how you would implement BFS in Python, including edge cases.
Think about how to handle special cases like isolated vertices.
Explain how you would modify the BFS algorithm to find the longest path in an unweighted graph.
Consider the inverse nature of finding longest as opposed to shortest.
5 more questions in this section. Enroll free to practise them all.
Enroll free