Paste: max-list

Author: kobi
Mode: factor
Date: Sat, 23 Oct 2010 08:18:32
Plain Text |
USING: accessors kernel slots.syntax math ;
IN: max-list
QUALIFIED-WITH: binary-tree bst
    
    
TUPLE: maxlist < limited-list min ;
    
: <maxlist> ( limit -- minlist )
    maxlist new swap >>limit ;

M: maxlist belongs? ( node maxlist -- ? )
    min>> dup [ bst:> ] [ 2drop t ] if ;

M: maxlist update ( maxlist -- )
    dup btree>> bst:min >>min drop ;

    

Annotation: oops - forgot removing the redundant min

Author: kobi
Mode: factor
Date: Sat, 23 Oct 2010 11:51:19
Plain Text |
M: maxlist remove-border ( maxlist -- )
    min>> remove ;
    

New Annotation

Summary:
Author:
Mode:
Body: