Yes
Yes...you can create an Array or ArrayList of size with*height, initializing all its values to null. Then instead of 'adding' the Vertex to the array, you set the Vertex value in the array...
Type: Posts; User: copeg
Yes
Yes...you can create an Array or ArrayList of size with*height, initializing all its values to null. Then instead of 'adding' the Vertex to the array, you set the Vertex value in the array...
First, the methods of Graph will throw a NullPointerException (caught in the addVertex method) - take a look at the scope of the variables in the constructor. Second, based upon what you have posted...
Not fully sure how you are storing your vertices (don't have time to look at the attachment), but I'd presume your graph has a method to retrieve a vertex at a particular position? Something like
...