A component of a graph is also a graph. Last year, I had to write code for stitching images that used a directional datastructure diagram that had 64,000 pixels, and it was not slow at all.
, github.
, datastructur. Linkedlist , , , - , , - , , .: 1 5 == 100, node Connected c = new connected(1,5,100);
: array[i].add(c) where i == 1
.
: :. , , , :
`for(Connected c : array[i].get();
int firstStudent = c.getFirst()
int secondStudent = c.getSecond()
int strength = c.getStrength();`
, .
: