5.17.2011

great idea

I got a great idea for how combine singly linked list (one possible connection), doubly linked list (two possible connections) and those with less (uhm, is that even possible?) and more. Most really good combination designs rely on long observation of all elements to combine and a good day for the observer. So I was once again observing possible generalizations of some necessary memory-saving structures (or classes if you want, it's the same in this case) for the my nxtOSEK experiments and discovered that you can of course also write every list item with n connections as some similar to the statically multi-dimensional vector I once designed. So you have N existing pointers which, depending on what kind of you want,
will work as singly-linked, doubly-linked or whatever linked lists. You just need a fixed format, for example pointer 1 is previous and 0 ist next. So all previous and next items have the same format and work completely unit. The best thing is that you can combine that in a very useful linkedlist format for all kinds of fixed-number links. So I finally found a good generalization for that. So there are those vectors for "statically sized arrays" (not really, I know), normal resizable arrays, lists with a static number of connections, list with a flexible number of connections, and... yeah. That's it. Everything else is a combine storage type and I'm comftable with creating these later when I finished this one super-functional item class. Though... I should create a list of it before.

No comments: