Re: binary search trees & binning
Re: binary search trees & binning
- Subject: Re: binary search trees & binning
- From: "Michael Ash" <email@hidden>
- Date: Tue, 15 Apr 2008 22:14:42 -0400
On Tue, Apr 15, 2008 at 5:38 PM, Jean-Daniel Dupas
<email@hidden> wrote:
> If you need a storage that provide binary search, you can probably use a
> CFBinaryHeap.
>
> "CFBinaryHeap implements a container that stores values sorted using a
> binary search algorithm. All binary heaps are mutable; there is not a
> separate immutable variety".
Despite the name, CFBinaryHeap does not provide any binary search facilities.
It is a priority queue, heap being another name for that. In other
words, it's an object where you can put things into it in any order,
but when you get an object from it that object is always the smallest
one in the container, and it's implemented so that this is very fast,
O(log n).
I can see ways to use this object to implement this sort of histogram,
but it doesn't let you specify an input value and get an index to the
closest match.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden