4 ms·
There aren't any algorithms to find things in an unsorted array in less than worst case linear time. I think you're confusing search (for some value) with selec
by aston 19y ago
There aren't any algorithms to find things in an unsorted array in less than worst case linear time. I think you're confusing search (for some value) with select (a value with a given index in the sorted array).
- Xichekolas 19y agoYeah, yeah I was... was just thinking about that over breakfast.
- eru 19y agoIf you want to do several searches on the same data - that is initially unsorted - you can get better than O(n) per query. But like you said - not for the first one.