chickadee » heap » heap-extremum

heap-extremum heapprocedure

Peak at the heap's extremum (min or max).

heap
The heap at which to peek
(define (heap-extremum heap)
  (if (heap-empty? heap)
    (error "Heap underflow -- HEAP-EXTREMUM")
    (element-datum (heap-ref heap 0))))