public int sizeOfAdj() {
        boolean end = false;
        int i = 0;
        while (!end ) {
            if (adj[i].size() == 0) {
                end = true;
            }
            else {i++;}
        }
        return i;
    }