Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heapify and addressable heap handlers #1

Open
stanojevic opened this issue Jan 9, 2019 · 3 comments
Open

heapify and addressable heap handlers #1

stanojevic opened this issue Jan 9, 2019 · 3 comments

Comments

@stanojevic
Copy link

Is there a way to get AddressableHeap.Handle for elements inserted with heapify method?

@d-michail
Copy link
Owner

Not really!

I guess you are referring to either DaryArrayAddressableHeap or BinaryArrayAddressableHeap.

I should add a method which also accepts a collection as argument and populates it with the handles.

@stanojevic
Copy link
Author

Yeah, I meant on BinaryArrayAddressableHeap. Maybe a better solution would be, if it's possible at all, to provide an iterator over the handles and then users of the library can populate their collections if they need to. As I can see, BinaryArrayAddressableHeap just needs to expose an iterator over the internal array (possibly with some filtering). I don't know if it's equally simple for other heaps.

Thanks for the quick reply and for this awesome library!

@d-michail
Copy link
Owner

Yes, an iterator over all handles is a more elegant solution. Other heaps do not have such a problem as they do not have a heapify method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants