Offline repost #3: The sentinel node

Heyheyheyheyhey----- Wikipedia once again brought some fabulous ideas. My problem with list complexity could get an interesting twist by using sentinel nodes. The idea is to not store seperate pointer for start/end, but providing an "invisible" node that's meant to be the null pointer value. So when inserting an element, there's already an existing node you link can link on both ends with the inserted element. This way it's to insert elements with less overhead but equal memory usage as well as a simpler interface with certain extra features. It's a lovely idea and I shall once again read Wikipedia a bit more when I'm having problems.

Seriously, this is an awesome thing. Everyone should have it. Or atleast more guys like me should read Wikipedia. I just I have to find something interesting and more exciting than my old implementations so that I feel good when writing it. Well, otherwise I'd probably rather play video games or so...

No comments: