yah
2023-10-21
Yet Another Heap
Upstream URL
Author
License
YAH - Yet Another Heap
[in package YAH]
YAH ASDF System
-
Version: 0.0.1
-
Description: Yet Another Heap
-
Licence: BSD-3
-
Author: Thomas Bartscher thomas-bartscher@weltraumschlangen.de
-
[class] FINGER
-
[class] HEAP
-
[function] MAKE-HEAP PREDICATE
Makes a heap sorting by predicate
PREDICATE. This means that if there are two values with keys A and B on the heap, if(funcall predicate a b)is true, A will be popped off the heap before B. -
[function] INSERT! HEAP KEY VALUE
Add
VALUEwith atKEYinto theHEAP. Returns a finger to the resulting entry in the heap. -
[function] EXTRACT! HEAP
Pop the top element from the
HEAP, according to the heap's predicate. Returns two values: The value and the key of the popped element.Fails if
HEAPis empty. -
[function] INSERT-EXTRACT! HEAP KEY VALUE
Insert
VALUEatKEYintoHEAP, then immediately pop the top element. -
[function] EXTRACT-INSERT! HEAP KEY VALUE
First pop the top element of
HEAP, then insertVALUEatKEY. Returns two values: The value and the key of the popped element.Fails if
HEAPis empty. -
[function] PEEK HEAP
Returns two values: The value and the key of the top element of the
HEAP. -
[function] CHANGE-KEY! HEAP FINGER KEY
Changes the key of
FINGERinHEAPtoKEY. -
[function] DELETE! HEAP FINGER
Remove
FINGERfromHEAP. -
[function] EMPTY-HEAP? HEAP
Returns
TifHEAPis empty, andNILotherwise.