A queue data structure is used if the elements need to be kept sorted. It allows to quickly pick the minimum element. If you need arbitrary access to the elements, use a LandArray instead. If you need arbitrary removal and insertion, use a LandList. If you need arbitrary access by something besides the index, use a LandHash. If you need multiple properties at once, e.g. arbitrary string lookup as well as sorting, your best bet might be to use two structures at once (or use your own structure).
Parameters: int(* cmp_cb)(void * data1, void * data2)
Returns: LandQueue*
Create a new queue, with the given comparison function for its elements.
Parameters: LandQueue * q
Delete the queue. This will not touch the elements that might have been added since its creation.
Parameters: LandQueue * q, void * data
Add an element to the queue.
Returns: void*
Return and remove the smallest element in the queue.
Returns: LandArray*
Return an array referencing the same data as the queue. The array will be sorted from smallest to largest element. The queue will be destroyed in the process. So you should set the parameter you passed to this function to None after it returns.
Parameters: LandQueue * self, int(* cb)(void * item, void * data), void * data
Returns: int
Like land_array_for_each. The callback will not be called in any particular order, especially it will not be sorted. (The first call will be the smallest element, but the subsequent order is random.)
Parameters: LandQueue * self