100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

CPSC110 problem set 9 solution

Rating
-
Sold
3
Pages
4
Uploaded on
05-01-2024
Written in
2023/2024

completed solution for problem set 9

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
January 5, 2024
Number of pages
4
Written in
2023/2024
Type
Other
Person
Unknown

Subjects

Content preview

(@problem 1)

;; Constants:

(define MAX-SLOTS-PER-TA 3) ;this is the max number of labs a TA can work

;; Data definiKons:

(@htdd Slot)
(define-struct slot (lab n))
;; Slot is (make-slot String Natural)
;; interp. the name of a lab - "A", "B", etc.
;; the lab's slot number - 1, 2, 3 etc.
;; A given lab can have mulKple slots, each slot
;; should have a unique number in that lab.
;;
(define SLOTS1
(list (make-slot "A" 1) (make-slot "A" 2) ;A needs 2 TAs
(make-slot "B" 1) ;B needs 1
(make-slot "C" 1) (make-slot "C" 2))) ;C needs 2

(@htdd TA)
(define-struct ta (name avail))
;; TA is (make-ta String (listof String))
;; interp. A TA with their name and the labs names they are free to work.

(define TAS1
(list (make-ta "Ali" (list "A" "B"))
(make-ta "Ari" (list "B" "C"))
(make-ta "Azi" (list "A" "C"))))


(@htdd Node)
(define-struct node (assignments slots))
;; Node is (make-node (listof (listof String)) (listof Slot))
;; interp. the list of assignments
;; remaining list of slots
(define N1 (make-node empty (list (make-slot "A" 1)
(make-slot "B" 1)
(make-slot "C" 1))))


(@htdf solve)
(@signature (listof Slot) (listof TA) -> (listof (listof String)) or false)
$8.48
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
skye3

Get to know the seller

Seller avatar
skye3 UBC
Follow You need to be logged in order to follow users or courses
Sold
5
Member since
1 year
Number of followers
1
Documents
9
Last sold
1 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions