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.
11 lines
45 B
Plaintext
11 lines
45 B
Plaintext
COM)B
|
|
B)C
|
|
C)D
|
|
D)E
|
|
E)F
|
|
B)G
|
|
G)H
|
|
D)I
|
|
E)J
|
|
J)K
|
|
K)L |