Class summary | |
---|---|
queue |
Method summary | |
---|---|
elements | queue |
key | queue |
last-cons | queue |
Function summary | |
---|---|
empty-queue? | q |
enqueue-at-end | q items |
enqueue-at-front | q items |
enqueue-by-priority | q items key |
heap-extract-min | heap key |
heap-insert | heap item key |
heap-left | i |
heap-min | heap |
heap-parent | i |
heap-right | i |
heap-sort | numbers &key (key (function identity)) |
heap-val | heap i key |
heapify | heap i key |
make-heap | &optional (size 100) |
merge-lists | list1 list2 predicate &key (result nil) (key (function identity)) |
merge-sort | list predicate &key (key (function identity)) |
queue-front | q |
queue-length | q |
remove-front | q |
:key | [Initarg] |
:last-cons | [Initarg] |
:elements | [Initarg] |
Insert the items by priority according to the key function.
Assume that the children of i are heaps, but that heap[i] may be larger than its children. If it is, move heap[i] down where it belongs. [Page 143 CL&R].
Pop the best (lowest valued) item off the heap. [Page 150 CL&R].
Return a sorted list, with elements that are < according to key first.