EXPLICA EL SIGUIENTE CODIGO PARA EXPOSICION
O método que verifica se um vértice já existe na lista de vértices é chamado ______.
Apuntes
EXPLICA EL SIGUIENTE CODIGO PARA EXPOSICION package graph; import estructura.*; public class GraphLink<E> { protected ListLinked<Vertex<E>> listVertex; Stack<E> path = new Stack<>(); private boolean dirigido; public GraphLink(boolean dirigido) { this.listVertex = new ListLinked<>(); this.dirigido = dirigido; } public void insertVertex(E data) { if (!searchVertex(data)) { Vertex<E> nuevo = new Vertex<>(data); listVertex.addLast(nuevo); }else { System.out.println("Duplicado"); } } private boolean searchVertex(E data) { Node<Vertex<E>> aux = listVertex.getHead(); while (aux != null) { if (aux.data.getData().equals(data)) { return true; } aux = aux.next; } return false; } private Vertex<E> getVertex(E data) { Node<Vertex<E>> aux = listVertex.getHead(); while (aux != null) { if (aux.data.getData().equals(data)) { return aux.data; } aux = aux.next; } return null; } public void insertEdge(E...
Estudia con juegos interactivos
Sube tus apuntes y genera flashcards, examenes y mas con IA
Empezar gratis