tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

12
Task/Set/Racket/set.rkt Normal file
View file

@ -0,0 +1,12 @@
#lang racket
(define A (set 1 2 3 4))
(define B (set 3 4 5 6))
(define C (set 4 5))
(set-union A B) ; gives (set 1 2 3 4 5 6)
(set-intersect A B) ; gives (set 3 4)
(set-subtract A B) ; gives (set 1 2)
(set=? A B) ; gives #f
(subset? C A) ; gives #f
(subset? C B) ; gives #t