Question
This assignment repeats Lab 2 (see below for lab 2 instructions). Instead of using an array to represent the adjacency matrix, you are to use
This assignment repeats Lab 2 (see below for lab 2 instructions). Instead of using an array to represent the adjacency matrix, you are to use the adjacency matrix to build the graph using a linked allocation.
The recursion is not the most important part of this assignment. You may choose to find the path iteratively. In any event, compare your solution for Lab 3 to your recursive solution of Lab 2. Also, compare the implementations.
Remember, you are responsible for showing that your program does all that it is supposed to do. If you put in any special features, you need to have an I/O set which demonstrates the features You will lose points for having insufficient I/O.
Your program should use the same I/O format as Lab2 and the same required input file. Make sure to allow for reasonable error situations. Your code should generate all the possible start-node end-node pairs for each graph. It is okay for the start and end nodes to be the same.
Make up some other graphs as additional input. You will lose points for having insufficient I/O. Remember, you are responsible for showing that your program does all that it is supposed to do. If
you put in any special features, you need to have an I/O set which demonstrates the features
Your program should read an adjacency matrix from the file, build the graph using linked structures, and process the graph to find all the paths, then read an new adjacency matrix, etc., until the file is empty. Make sure to allow for reasonable error situations. Programs which use the adjacency nmatrix to find the paths will receive no credit under correctness.
You may not use Array lists or List classes from the Java library.
You may store the adjacency matrix in any way you like. You may use any variation of linked strucutres to represent the graph. Justify your implementation and design decisions.
4 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 6 0 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 1 3 0 1 1 1 0 1 1 1 0
605.202 Data Structures and Algorithms Node B is considered adjacent to node A if there is a directed edge from A to B. A il oly be adjacent to B if there is also an edge from B to A. It is possible to associate a matrix called the 6 are the most useful are the ones which do not contain loops (cycles), .e.. do not visit a node more 3 2 0 be the same. 12 1 is OK but not 121241 2 Write a program to read in the number of nodes in the graph and the corresponding adjacency matrix, one row at a time. Echo the adjacency matrix to your output file. The program should use each graph. See the attached file for the required input. Make up some other graphs as additional input. You will lose points for having insufficient I/O The recursion is the most important part of this assignment. Use an array to store the adjacency part of your analysis. What impact would that have on your data strucutres you put in any special features, you need to have an IO set which demonstrates the features paths, then read an new adjacency matrix, until the file is empty. Make sure to allow for reasonable 605.202 Data Structures and Algorithms Node B is considered adjacent to node A if there is a directed edge from A to B. A il oly be adjacent to B if there is also an edge from B to A. It is possible to associate a matrix called the 6 are the most useful are the ones which do not contain loops (cycles), .e.. do not visit a node more 3 2 0 be the same. 12 1 is OK but not 121241 2 Write a program to read in the number of nodes in the graph and the corresponding adjacency matrix, one row at a time. Echo the adjacency matrix to your output file. The program should use each graph. See the attached file for the required input. Make up some other graphs as additional input. You will lose points for having insufficient I/O The recursion is the most important part of this assignment. Use an array to store the adjacency part of your analysis. What impact would that have on your data strucutres you put in any special features, you need to have an IO set which demonstrates the features paths, then read an new adjacency matrix, until the file is empty. Make sure to allow for reasonable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started