3 ms·
Cool! Hadn't seen that before, neat trick. Seems to me like (as other commenters have pointed out) this wouldn't be a great idea for something that is stored a
by joeld42 14y ago
Cool! Hadn't seen that before, neat trick.
Seems to me like (as other commenters have pointed out) this wouldn't be a great idea for something that is stored as a straightforward linked list.
Where it seems really useful to me is a cheap way to store an alternate ordering on top of an existing data structure, without having to keep a separate list around. I've done this before, using next pointers to preserve an alternate ordering, but this is a nice way to allow it to be bidirectional. neat.