logo       

[patch #5667] Add heap (priority queue) implementation to libpspp: msg#00023

statistics.pspp.devel

Subject: [patch #5667] Add heap (priority queue) implementation to libpspp


Update of patch #5667 (project pspp):

Assigned to: jmd => blp

_______________________________________________________

Follow-up Comment #1:

I can't see any major issues.


I was confused by the function is_heap. What does UNUSED mean on the return
value? If the return value is never used, then why not return void? Or does
it mean the function itself is never used (in which case why have it?)
Similarly is_k_composition.

It seems that argument 1 of less and lesser_node could be const.

My guess is, that the most common use would want the aux arguments of
heap_create and heap_compare_func to be const.

Perhaps the comment in heap.h needs to be clearer:
/* A node in a heap. Opaque. */
struct heap_node
{
size_t idx;
};
If struct heap_node is opaque, then why have it in the .h file ?
I think you mean that heap nodes must have a idx member, but all other
elements are indeterminate.

Other issues, which may or may not be relevent, depending on how you're
intending to use this:

0 How about a version of heap_create, which uses a pool, the same as we have
for hash?

0 A version, where the nodes inserted are const?




_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/patch/?5667>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise