;; -*- Scheme -*-
;;
;; $Id: avl-tree00.scm,v 1.1 1998/03/16 07:57:13 foner Exp $

(define avl-tree::left
  (lambda (avl-tree)
;    (if (not (vector? avl-tree)) (error 'avl-tree::left "oops"))
    (vector-ref avl-tree 0)))


(define avl-tree::data
  (lambda (avl-tree)
;    (if (not (vector? avl-tree)) (error 'avl-tree::data "oops"))
    (vector-ref avl-tree 1)))


(define avl-tree::height
  (lambda (avl-tree)
    (if (avl-tree:nil? avl-tree)
	0
	(vector-ref avl-tree 2))))

(define avl-tree::right
  (lambda (avl-tree)
;    (if (not (vector? avl-tree)) (error 'avl-tree::right "oops"))
    (vector-ref avl-tree 3)))

(define avl-tree::make
  (lambda (left data height right)
    (vector left data height right)))

;;+doc
;; constant: avl-tree:nil
;; signature: avl-tree
;;
;; The empty AVL-TREE
;;-doc

(define avl-tree:nil '())


;;+doc
;; procedure: avl-tree:nil?
;; arguments: tree
;; signature: avl-tree -> bool
;; 
;; Determines if TREE is empty or not.
;;-doc

(define avl-tree:nil? null?)

;-------------

;exports avl-tree::left
;exports avl-tree::data
;exports avl-tree::height
;exports avl-tree::right
;exports avl-tree::make

;------------

;; eof
