[SOLVED] CSCI390 Assignment 1

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon as1-xmv9pm.zip (14.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

his assignment, there are two python files:

  • as1_bfs.py: we have already implemented the basic BFS algorithm, which can work properly with the non-loopy path.
  • as1_test.py: you can use this file to test your implementation. In this file, we included two data structures that reflect the tree. These are also the trees that we will use to grade your implementation.

Tasks: two functions need to be implemented:

  1. def traverse(tree, init): BFS traversal function. This func accepts two inputs: the tree to traverse and the initial state. We already provided an example of how to run this func in the as1_test.py. Your task is to modify it to run with the loopy path. So far, if you try to traverse the tree_2 without a valid modification, your program crashes.
  2. def pathfinder(tree, init, goal): still BFS traversal function. However, this func accepts three inputs: the tree, the initial state, and the goal state. Your task is to find the solution from the initial state to the goal state even we have the loopy path in the tree.
  • as1-xmv9pm.zip