[funds-cvs] r117 - in trunk/funds/src/trees: . heap
abaine at common-lisp.net
abaine at common-lisp.net
Sat Aug 4 14:16:11 UTC 2007
Author: abaine
Date: Sat Aug 4 10:16:11 2007
New Revision: 117
Modified:
trunk/funds/src/trees/constructors.lisp
trunk/funds/src/trees/heap/heap.lisp
Log:
Moved heap constructor to heap.lisp.
Modified: trunk/funds/src/trees/constructors.lisp
==============================================================================
--- trunk/funds/src/trees/constructors.lisp (original)
+++ trunk/funds/src/trees/constructors.lisp Sat Aug 4 10:16:11 2007
@@ -36,13 +36,3 @@
(defun make-avl-tree ()
(make-avl-leaf))
-(defun make-heap (&key (priority 0 p-p) value
- (left (make-heap-leaf)) (right (make-heap-leaf)))
- (if p-p
- (make-instance 'heap
- :priority priority
- :value value
- :left left
- :right right
- :weight (+ 1 (tree-weight left) (tree-weight right)))
- (make-heap-leaf)))
Modified: trunk/funds/src/trees/heap/heap.lisp
==============================================================================
--- trunk/funds/src/trees/heap/heap.lisp (original)
+++ trunk/funds/src/trees/heap/heap.lisp Sat Aug 4 10:16:11 2007
@@ -1,6 +1,17 @@
(in-package :funds)
+(defun make-heap (&key (priority 0 p-p) value
+ (left (make-heap-leaf)) (right (make-heap-leaf)))
+ (if p-p
+ (make-instance 'heap
+ :priority priority
+ :value value
+ :left left
+ :right right
+ :weight (+ 1 (tree-weight left) (tree-weight right)))
+ (make-heap-leaf)))
+
(defun attach-heap (root &key left right)
(make-heap :priority (heap-priority root)
:value (bt-value root)
More information about the Funds-cvs
mailing list