Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Notas de lectura

Problem set 6 - CPSC 110 - UBC 2024

Puntuación
-
Vendido
1
Páginas
10
Subido en
20-12-2022
Escrito en
2022/2023

Completed file for problem set 6. Remember to copy the pdf file to Dr Racket for a better view. This file should be exactly identical except that the file has answers for each problems.

Institución
Grado

Vista previa del contenido

;; DO NOT PUT ANYTHING PERSONALLY IDENTIFYING BEYOND YOUR
CWL IN THIS FILE.
;; YOUR CWLs WILL BE SUFFICIENT TO IDENTIFY YOU AND, IF YOU HAVE
ONE, YOUR
;; PARTNER.
;;
(require spd/tags)

(@assignment psets/pset-06); Do not edit or remove this tag

;; If you are:
;; - A 110 or 107 student replace the first set of '???'s with your cwl.
;; For problem sets, If you have a partner, please replace the second
;; set of '???'s with their cwl. Remember this, it is what you will
;; do with these @cwl annotations for the whole course.
;; - A UBC Extended Learning student, replace the first set of ??? with
;; your email address as confirmed in the email you received from
;; extended learning. The handin password is also in that email.
;; Remember this, it is what you will do with these @cwl annotations
;; for the whole course.
;;
(@cwl ??? ???)


(@problem 1)
;; Below is the start of a data definition called Course that represents limited
;; information about UBC courses. Below there are only two example data.
;; Please complete this definition by adding constants C110, C213, C313 and
C317
;; which are representations of the descendent tree for 110, 213, 313 and 317.
;; You can find the information you need at
;; https://cs110.students.cs.ubc.ca/psets/pset-06-image.png
;;
;; NOTE 1: Use the information in the image above, rather than any other
source.
;; We are significantly simplying the information.
;;
;; NOTE 2: Do this very carefully, the autograder wants to see correct results
;; from the functions you design to operate on this data.
;;

, ;; NOTE 3: The tree you will make for C110 will be a bit odd because 210 has
110
;; as a pre-req, and both 213 and 221 have 210 as a pre-req, and 313 has
;; 213 AND 221 as a pre-req, and 317 has 213 AND 221 as a pre-req. As a
;; result, 313 and 317 will both show up twice in your descendent tree
; for C110. This is okay for this problem set.
;; NOTE 4: Expect this step of the problem set to take you some time.




(@htdd Course ListOfCourse)
(define-struct course (number credits dependents))
;; Course is (make-course Natural Natural ListOfCourse)
;; interp. a course with a course number,
;; the number of credits the course is worth, and a
;; list of courses that list this course as a direct pre-requisite

;; ListOfCourse is one of:
;; - empty
;; - (cons Course ListOfCourse)
;; interp. a list of courses

(define LOC0 empty)
(define C100 (make-course 100 3 LOC0))

;; Course require C213

(define C313 (make-course 313 3 empty))
(define C317 (make-course 317 3 empty))

;; course require C221

(define C304 (make-course 304 3 empty))

(define C314 (make-course 314 3 empty))

(define C320 (make-course 320 3 empty))

(define C322 (make-course 322 3 empty))

;; course require 310

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

Subido en
20 de diciembre de 2022
Número de páginas
10
Escrito en
2022/2023
Tipo
NOTAS DE LECTURA
Profesor(es)
Gregor kiczales
Contiene
Todas las clases

Temas

$6.99
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
tranghane Alfa-college
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
84
Miembro desde
3 año
Número de seguidores
57
Documentos
24
Última venta
3 meses hace

2.4

7 reseñas

5
1
4
1
3
1
2
1
1
3

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes