I need simple python questions to be coded
Posted: Sun May 15, 2022 12:51 pm
I need simple python questions to be coded
Problems 1. Implement a breadth-first search algorithm (20 points) Class Example of BFS def bfs (graph, start) your code here 2. Create a program which takes as input two 4-letter words (start, end). The output of your program should be a path between them, if it exists. Every word should be only one letter different, the letter changed must be in the same position in both words. (20 points) Example Console Output: What is the first word? FOOL What is the second word? SAGE > FOOL > POOL > POLL >> POLE > PALE > SALE > SAGE
3. Create a program which can calculate the path through the maze below. The output of your program should be a path through the maze. (20 points)lda Exit Entrance 4. What is the running time of BFS if we represent its input graph by an adjacency matrix and modify the algorithm to handle this form of input? (20 points) 5. Let G = (V, E) be a connected, undirected graph. Give an O(V + E)-time algorithm to compute a path in G that traverses each edge in E exactly once in each direction. Describe how you can find your way out of a maze if you are given a large supply of pennies. (20 points) Terminology and Definitions
Problems 1. Implement a breadth-first search algorithm (20 points) Class Example of BFS def bfs (graph, start) your code here 2. Create a program which takes as input two 4-letter words (start, end). The output of your program should be a path between them, if it exists. Every word should be only one letter different, the letter changed must be in the same position in both words. (20 points) Example Console Output: What is the first word? FOOL What is the second word? SAGE > FOOL > POOL > POLL >> POLE > PALE > SALE > SAGE
3. Create a program which can calculate the path through the maze below. The output of your program should be a path through the maze. (20 points)lda Exit Entrance 4. What is the running time of BFS if we represent its input graph by an adjacency matrix and modify the algorithm to handle this form of input? (20 points) 5. Let G = (V, E) be a connected, undirected graph. Give an O(V + E)-time algorithm to compute a path in G that traverses each edge in E exactly once in each direction. Describe how you can find your way out of a maze if you are given a large supply of pennies. (20 points) Terminology and Definitions