An interesting data structure with search time O(sqrt n)

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 30 18:33:06 PST 2015


On 11/30/2015 09:57 PM, Andrei Alexandrescu wrote:
> So now consider my square heaps. We have O(n) build time (just a bunch
> of heapifications) and O(sqrt n) search.

How do you build in O(n)? (The initial array is assumed to be completely 
unordered, afaict.)


More information about the Digitalmars-d mailing list