I'm reasonably happy with this. I started with a bi-directional linked list, but realized that a flat list of all nodes came in handy for one use case while the linked list came in handy for another, so I settled on that.
13 lines
57 B
Plaintext
13 lines
57 B
Plaintext
COM)B
|
|
B)C
|
|
C)D
|
|
D)E
|
|
E)F
|
|
B)G
|
|
G)H
|
|
D)I
|
|
E)J
|
|
J)K
|
|
K)L
|
|
K)YOU
|
|
I)SAN |