A.19 library(heaps): heaps/priority queues
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(heaps): heaps/priority queues
          • add_to_heap/4
          • delete_from_heap/4
          • empty_heap/1
          • singleton_heap/3
          • get_from_heap/4
          • heap_size/2
          • heap_to_list/2
          • is_heap/1
          • list_to_heap/2
          • min_of_heap/3
          • min_of_heap/5
          • merge_heaps/3
    • Packages
Availability::- use_module(library(heaps)).(can be autoloaded)
Source[semidet]min_of_heap(+Heap, ?Priority1, ?Key1, ?Priority2, ?Key2)
Gets the two minimum-priority elements from Heap. Complexity: logarithmic (amortized).

Do not use this predicate; it exists for compatibility with earlier implementations of this library and the SICStus counterpart. It performs a linear amount of work in the worst case that a following get_from_heap has to re-do.