Purpose: Understand graph and its representations (adjacency matrix and adjacency list) Implement graph traversal algorithms (Breadth-First Traversal and Depth-First Traversal) TaskDescriptions: ...

1 answer below »


Purpose:



  1. Understand graph and its representations (adjacency matrix and adjacency list)

  2. Implement graph traversal algorithms (Breadth-First Traversal and Depth-First Traversal)



TaskDescriptions:



Task 1:
Write Java code that creates the graph below and implements an algorithm that performs a
breadth-first traversal
of the graph, beginning at the node labeled . Please display nodes in order in which vertices are visited.






Task 2:
Write Java code that creates the graph above and implements
an iterative algorithm
that performs a
depth-first traversal
of the graph, beginning at the node labeled . Please display nodes in order in which vertices are visited. (Note: please use stack for your iterative algorithm, not recursive method)


You will be graded based on the quality of your program.
Please mention if Java interface and generic data type are used or not, as bonus will be considered for those who use Java interface and generic data type. Also, bonus will be considered for those who provide two versions (using adjacency matrix representation and using adjacency list). Screencast and unit testing are also extra credit worthy. Make sure your code will compile within my environment which use strict rules. (Tip: you can use a Java linter add-on to get all the warnings cleared.)



What to Submit?


1. Source codes for Tasks 1 and 2 (Note: properly comment your codes)


2. Readme.md (describes what graph representation you used and how to run your code)


Answered 4 days AfterMar 28, 2021

Answer To: Purpose: Understand graph and its representations (adjacency matrix and adjacency list) Implement...

Vibhav answered on Apr 02 2021
146 Votes
Graph/Task 1/1.JPG
Graph/Task 1/Graph.java
Graph/Task...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here