No, there is no way to make an efficient lookup in a linked list. You can do some trickery with skip lists, but at the end of the day a linked list is still the wrong data structure for fast lookups. If you are working with indices, arrays might be the better option (unless you have lots of deletes and insertions in which case you have to copy lots of data around all the time). If you don't care about the order of your data and just want blazing fast lookups, a hash table might be the better solution. And if you want to maintain order but also fast insertions and deletes, a balanced binary tree might com ein handy.

Long story short; Get your hands dirty and an overview of commonly used data structures. There is no perfect data structure and each has it's own advantages and disadvantages, knowing them allows you to write efficient code.

Edit: Damn, the clockwork was faster!

Last edited by JustSid; 11/21/12 15:43.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com