Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package grafo;
- import java.util.ArrayList;
- /**
- * Created by jaime on 31-03-2015.
- */
- public class Grafo<T> {
- public ArrayList<Vertice> vertices;
- public Grafo() {
- vertices = new ArrayList<Vertice>();
- }
- public void insertarVertice(Vertice<T> v) {
- vertices.add(v);
- }
- @Override
- public String toString(){
- String cadena ="";
- for (int i = 0; i <vertices.size() ; i++) {
- cadena += "\n" + vertices.get(i).toString();
- }
- return cadena;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement