623
1 Like

DSA Crash Course [Part 55] - Undirected Path Approach

In this lesson, Alvin explores the strategy to solving the following interview problem:

Write a function, undirected_path, that takes in a list of edges for an undirected graph and two nodes (*node_A*, node_B). The function should return a boolean indicating whether or not there exists a path between node_A and node_B.

edges = [
('i', 'j'),
('k', 'i'),
('m', 'k'),
('k', 'l'),
('o