-2

how do I implement these methods in a Java Breadth first graph while using Queues?

An add method which adds a new vertex into the graph without any edges?

How can I return the Adjacency matrix?

if it contains a Triangle?

1 Answers1

0

Although I'm not sure what you're asking, you might want to take a look at this question and answer.

There you will find the description and implementation of a breadth-first search algorithm using Queue in Java.

Community
  • 1
  • 1
marcelovca90
  • 2,673
  • 3
  • 27
  • 34