given the example in this article and and the example you posted, where "->" represents a linked list, you would have a 2d linked list that looks like below ?
0->2->4
1->3->4
2->5
3->6
6->0
The first number in the pair is the row number, and the second number is a node in the list represented by the row number.
Is that how you define your problem?