Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
(lib 'list) ;; for list-delete
|
||||
|
||||
(define dataM
|
||||
'((the cat sat on the mat)
|
||||
(the cat sat on the mat)
|
||||
(A B C A B C A B C)
|
||||
(A B C A B D A B E)
|
||||
(A B)
|
||||
(A B)
|
||||
(A B B A)))
|
||||
|
||||
(define orderM
|
||||
'((mat cat)
|
||||
(cat mat)
|
||||
(C A C A)
|
||||
(E A D A)
|
||||
(B)
|
||||
(B A)
|
||||
(B A)))
|
||||
|
||||
(define (order-disjoint M N)
|
||||
(define R (append N null)) ;; tmp copy of N : delete w when used
|
||||
(for/list [(w M)]
|
||||
(if
|
||||
(not (member w R)) w ;; output as is
|
||||
(begin0
|
||||
(first N) ;; replacer
|
||||
(set! N (rest N))
|
||||
(set! R (list-delete R w))))))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue