;element-of-set? stays the same and
; is O(n) operation
;adjoin-set
;its a O(1) operation now
(define (adjoin-set x set)
(cons x set))
;union-set
;its a O(n) operation now
(define (union-set set1 set2)
(append set1 set2))
;intersection-set stays the same and
;is O(n^2) operation
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment