100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CPSC110 problem set 9 solution CA$12.59
Add to cart

Other

CPSC110 problem set 9 solution

 248 views  3 purchases

completed solution for problem set 9

Preview 1 out of 4  pages

  • January 5, 2024
  • 4
  • 2023/2024
  • Other
  • Unknown
All documents for this subject (19)
avatar-seller
skye3
(@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)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller skye3. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for CA$12.59. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53068 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
CA$12.59  3x  sold
  • (0)
Add to cart
Added