logo

Crowdly

Considerando la clase Vertex (vértice de un grafo) dada abajo, ¿cómo definirí...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Considerando la clase Vertex

(vértice de un grafo) dada abajo, ¿cómo definirías una clase llamada Edge

(arco), que contenga los dos vértices que conecta?

public class Vertex<T> {

  private long id;

  private T data; 

  public Vertex(long id, T data) { this.id = id; this.data = data; }

  public T getData() { return this.data; }

  public

String

toString() {

return "v" + this.id + "=" + this.data; } 

}

More questions like this

Want instant access to all verified answers on moodle.uam.es?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!