I understand Arraylists, these allow you to create a variable size array, and allows you to use the get method to retrieve the values and the add method to add values. However what I’m looking for is a way to implement the following functionality.
Backupstar[i] is used as a reference and each visited object is marked with the id contained in backupstar[i] and its distance to it. Backupstar[i] is also marked with all the cells which it has visited, and in this way I can check the distance from the original backupstar[i].
Using an array would not allow me to solve my problem, as the property which I’m creating contains both the cell id and distance. If I were using an array i understand that I could use a multidimensional array, ie 2 deep. But then i would not be able to use the include function to check the values it contained unless i iterated with a loop, which can become quite costly.