ocramz / depq

Double-ended priority queues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an unkeyed version

treeowl opened this issue · comments

On 64-bit architectures, it should be possible to offer a basic version (without efficient meld) that doesn't expose keys to the user. Just stash a counter and use it to generate keys for insertion.

@treeowl two questions :

  • why 64 bit archs only?
  • what's "meld" ?

So the idea there was to just have a 64-bit counter assigning a (meaningless) key to each priority/value pair, to allow the min or max to be deleted. The word "meld" is sometimes used for the operation of taking the union of two priority queues. A counter-bumping approach doesn't support logarithmic-time meld; maybe it supports linear-time meld though.