I need an algorithm that introduces data like a stack, so when I scan the structure I can read them in the same sequence as they were introduced, for sequential access. Also these values are stored in buckets, like a hashtable, so I can fragment the whole structure for disk storage and have fast random access.
Is there an algorithm like this, or should I have two separate structures? What’s the best strategy?
Best regards!
What I would probably do would be this: