DataStructures-and-Algorithms

Code Challenge

Implement a breadth-first traversal on a graph.

Specifications

Challenge Setup & Execution

Branch Name: graph-breadth-first

Challenge Type: Extending an Implementation

Feature Tasks

Write the following method for the Graph class:

Structure and Testing

Utilize the Single-responsibility principle: any methods you write should be clean, reusable, abstract component parts to the whole challenge. You will be given feedback and marked down if you attempt to define a large, complex algorithm in one function definition.

Write at least three test assertions for each method that you define.

Ensure your tests are passing before you submit your solution.

Example

Graph

Output:

Pandora, Arendelle, Metroville, Monstroplolis, Narnia, Naboo

Stretch Goal

Once you’ve achieved a working solution, define a new method that accepts two nodes as input and uses your traversal algorithm to determine if a path exists between the two nodes.

Documentation: Your README.md

```markdown

Breadth-First Traversal of a Graph

Challenge

Approach & Efficiency

Solution

Requirements

Ensure your complete solution follows the standard requirements.

  1. Write unit tests
  2. Follow the template for a well-formatted README
  3. Submit the assignment following these instructions