Paste: min-list

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

M: minlist belongs? ( node minlist -- ? )
    max>> dup [ bst:< ] [ 2drop t ] if ;

M: minlist update ( minlist -- )
    dup btree>> bst:max >>max drop ;

    

Annotation: oops - now removing the border value

Author: kobi
Mode: factor
Date: Sat, 23 Oct 2010 11:54:04
Plain Text |
M: minlist remove-border ( minlist -- )
    max>> remove ;
    

New Annotation

Summary:
Author:
Mode:
Body: