Skip to content

Instantly share code, notes, and snippets.

@Montolide
Montolide / Graph.java
Last active December 14, 2015 11:49 — forked from MastaP/Graph.java
Changed "MastaP / Graph.java" to use interative method, since I was having problems with StackOverflowException
package org.coursera.algo;
import java.util.*;
public abstract class Graph<V extends AbstractVertex<E>, E extends AbstractEdge<V>> {
private final TreeMap<Integer, V> vertices = new TreeMap<Integer, V>(
new Comparator<Integer>() {
//for pretty printing
@Override