I am trying to create a depth first search algorithm here, kind of. Instead of traversing and finding out how many values it had to go through, it should be finding the highest value in each row.
I know how to actually implement the search and everything but the one part I can't figure out, especially since googling it doesn't work very well is how to create an array of Sub Classes/childs.
I don't really need to know how to initialize a general array, but rather how to initialize an array when I have a class of Node with 2 int values, and then I want an array of said Nodes with the 2 values in them
e.g. right now I have
Node Node1 = new Node(1,1);
Node Node2 = new Node(2,3);
Node Node3 = new Node(2,2);
Node Node4 = new Node(3,5);
Node Node5 = new Node(3,3);
Node Node6 = new Node(3,9);
I want to use an array where it would be something like Node[0] = 1,1 or something similar to that - is there any way this could be done in Java?