Embedded List

This is a container that removes a level of indirection from the standard implementation of a linked list, and sticks the next pointers inside the contained object itself. It has some advantages if you have an appropriate situation, such as it does not allocate any memory, and is thus very fast and safe.

An appropriate situation is: partitioning the entire set (or most of it) of instances of some class into disjoint sets. Say, for example, I don’t know, a collision detection algorithm implemented with a quad-tree. :-)

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s