Your code works fine (the sample), but that's only because each node is only linked to it's next node. My scenario is a little more complicated. Lets take this for instance, a list of 6 nodes and longlinks of 3: so the design looks like the following:

1 ----> 2( shortlink) && 1 ----> 4(longlink)
2 ----> 3( shortlink) && 1 ----> 5(longlink)
3 ----> 4( shortlink) && 1 ----> 6(longlink)
4 ----> 5( shortlink) && 1 ----> 1(longlink)
5 ----> 6( shortlink) && 1 ----> 2(longlink)
6 ----> 1( shortlink) && 1 ----> 3(longlink)

Shortlinks are working fine. Now in that scenario, if i deleted node 1, that means nothing shall point to it . We must oberve though node 1 has a shortlink to 1 and a longlink to 4. Anyway, as you can see there, node 4 has a longlink to node 1, but node 1 is deleted, therefore this is wrong. So what i need to be able to do is, node 4 must point to the long link of the delete nodes long list. After deleting node 1, it should now look like




2 ----> 3( shortlink) && 1 ----> 5(longlink)
3 ----> 4( shortlink) && 1 ----> 6(longlink)
4 ----> 5( shortlink) && 1 ----> 4(longlink) ( 4's longlink must point to itself because 1's longlink was 4
5 ----> 6( shortlink) && 1 ----> 2(longlink)
6 ----> 2( shortlink) && 1 ----> 3(longlink) (notice 6's shortlink is now 2 - this works fine).


My output is giving me this:

2 ----> 3( shortlink) && 1 ----> 5(longlink)
3 ----> 4( shortlink) && 1 ----> 6(longlink)
4 ----> 5( shortlink) && 1 ----> 0(longlink) (this should not be pointing to 0, it should be 4)
5 ----> 6( shortlink) && 1 ----> 2(longlink)
6 ----> 2( shortlink) && 1 ----> 3(longlink)

Hopefully that clarifies my situation atm, and i'd really be grateful for some assistance.