Question: Please help me with this java assignment: (Instructions throughout and copy and paste code from the bottom :) ) Here is the base code to

Please help me with this java assignment: (Instructions throughout and copy and paste code from the bottom :) )

Please help me with this java assignment: (Instructions throughout and copy andpaste code from the bottom :) ) Here is the base codeto copy and paste: import java.util.Arrays; import java.util.Vector; public class DistrictMaker implementsComparable { /** * Each DistrictMaker object has an internal 2-D gridand a size. */ private int[][] map; private int size; /** *

The DistrictMaker class has a single master list (a Java Vector) *for keeping track of all of the maps it makes in agiven run. */ public static Vector list = new Vector(); /** *

Here is the base code to copy and paste:

import java.util.Arrays; import java.util.Vector;
public class DistrictMaker implements Comparable { /** * Each DistrictMaker object has an internal 2-D grid and a size. */ private int[][] map; private int size; /** * The DistrictMaker class has a single master list (a Java Vector) * for keeping track of all of the maps it makes in a given run. */ public static Vector list = new Vector(); /** * Constructor initializes a map grid. * * @param map Initial map to store. A deep copy is made. */ public DistrictMaker(int[][] map) { this.map = new int[map.length][map[0].length]; for (int i = 0; i = size) || (col = size)) return; /* Square already in use */ if (map[row][col] != 0) return; map[row][col] = district; /* Have placed all the squares I need */ if (count == 1) { /* If there are more districts to place, restart recursion. */ if (district > 1) { /* Search for first open square as root of next search */ for (int i = 0; i   import java.util.Arrays; import java.util.Vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!