Permalink
Browse files

LET* => LET

  • Loading branch information...
1 parent a635768 commit bfba26a3d51c90ae9de46fe9af4e77bd68473c30 Stephan Frank committed Apr 5, 2012
Showing with 9 additions and 9 deletions.
  1. +2 −2 README
  2. +7 −7 rank-pairing-heap.lisp
View
4 README
@@ -11,8 +11,8 @@ the table below.
Executive summary: for almost all cases the 'pairing heap' should give
you the best performance. The 'rank pairing heap'
- has slightly worse overall but better worst case
- performance.
+ has slightly worse overall performance but better
+ worst case behaviour.
The different heap data structures posess the following computational
complexities (amortized complexity is annotated with a '*'):
View
@@ -60,15 +60,15 @@
(defun extract-min (heap)
(declare (type rank-pairing-heap heap))
- (let* ((root (slot-value heap 'root))
- (buckets (make-array (ceiling (log most-positive-fixnum (/ (1+ (sqrt 5)) 2)))
- ;; approx of max. required buckets
- :element-type '(or null node)
- :initial-element nil)))
+ (let ((root (slot-value heap 'root))
+ (buckets (make-array (ceiling (log most-positive-fixnum (/ (1+ (sqrt 5)) 2)))
+ ;; approx of max. required buckets
+ :element-type '(or null node)
+ :initial-element nil)))
(declare (dynamic-extent buckets))
(if (zerop (decf (slot-value heap 'size)))
(setf (slot-value heap 'root) nil)
- (let (tree)
+ (let ((tree))
(loop for i = (node-lchild root) then next
for next = (shiftf (node-rchild i) nil)
with result = nil
@@ -197,7 +197,7 @@ empty after this operation but may be used further."
nil))
;; restore rank rule for decreased node
(setf (node-rank node)
- (1+ (d-rank (node-lchild node))))
+ (1+ (the fixnum (d-rank (node-lchild node)))))
;; type-2 rank reduction
(loop for u = (shiftf (node-parent node) nil) then (node-parent u)
for rv = (d-rank (node-lchild u))

0 comments on commit bfba26a

Please sign in to comment.