Efficiency of getElements() - getElements is not one of the standard operations for disjoint sets - it is not one that we discussed in class. It turns out having a method like this is very useful in some cases - testing you code is one of those! Other times this is something you might want to do, but not very often. So you should try to implement it as efficiently as you can, but NOT at the expense of the union and find operations. This goes for the other operations in the DisjointSets interface other than union and find as well.
In general, you want to think about what operations you will need to do with your data structure and how often you will do each of these. Then you want to pick a data structure that implements the operations you will do most often, most efficiently. Usually there is a trade off in that you cannot do ALL operations as quickly as you would like with a single implementation (remember the first implementations of disjoint sets I proposed using an array and then an array of pointers to linked lists?) so you have to think about how you will actually be using the data structure to guide your choice of implementation.
Using stuff from Java Collections - You should avoid using things from the java collections for your Disjoint Sets implementation (this includes calls to methods in Arrays like copyOfRange. Using them for your maze generation (this includes using them to represent the sets E or Maze), however is fine.
Union on non-roots - You should require that parameters be roots as the interface says. So this means that the client code must be sure that what it is passing is a root (and your code should complain if not).
Note: Another way of implementing this would be to have Union call find on each parameter that is passed in. While this is a fine way of implementing Union, this is NOT what we are asking for in this assignment. For this assignment we ask that you raise an exception (IllegalArgumentException or your own exception class will be fine).
Error checking in maze generation - For your maze generation program you should do error checking similar to the extent that is done in Reverse.java for homework #1. A maze dimension of 0 should be illegal. You may handle a maze of size 1 x 1 however you would like (as legal or illegal).