Verified Documents at University of British Columbia

Browse the full collection of course materials, past exams, study guides and class notes for CPSC 110 - Computation, Programs, and Programming at University of British Columbia …
PROFESSORS
All Professors
All semesters
Anthony Estey
fall
23

Verified Documents for Anthony Estey

Class Notes

Taken by our most diligent verified note takers in class covering the entire semester.
CPSC 110 Lecture 2: CPSC 110
2226
CPSC 110 Lecture 5: cpsc 110 104
; problem: design a data definition to represent the name of any sports team. ; then design a function that consumes a team name and determines whether
4137
CPSC 110 Lecture Notes - Lecture 6: Data Definition Language
; given the data definition and function design below, identify. ; and correct the errors in the >>>function<<< design. ; assume that
4191
CPSC 110 Lecture 7: CPSC 110
Design a world program in which a spider starts at the top of the screen and moves down the screen. Assume the spider always moves at the same speed. T
3144
CPSC 110 Lecture 8: cpsc 110 104
; design a world program in which a spider starts at the top of the screen and. Assume the spider always moves at the same speed. ; then improve your p
4216
CPSC 110 Lecture Notes - Lecture 9: Angle Of Rotation
;; design a world program where yoshi eggs appear wherever. ;; the user clicks the mouse and each egg spins as it falls. ;; there are no eggs, but each
4160
CPSC 110 Lecture 10: cpsc 110 104
; problem: design a function that when given an natural n, produces a list of. ; naturals from n down to 1. (@htdf blist) (@signature natural -> lis
4199
CPSC 110 Lecture 11: CPSC 110
In this problem imagine you have information about a bunch of people that you would like to store as data and present in different ways. ;; constants:
3120
CPSC 110 Lecture Notes - Lecture 12: Binary Search Tree, Binary Tree, Insert Key
(require 2htdp/image) (require spd/tags) (define text-size 14) (define text-color black) Complete the design of the data definition below to represent
559
CPSC 110 Lecture 13: CPSC 110
;; region and listofregion data definitions provided. (@htdd region listofregion) (define-struct single (label weight color)) (define-struct group (col
5197
CPSC 110 Lecture Notes - Lecture 14: Cross Product, Binary Tree
;; interp. a list of numbers (define lon0 empty) (define lon1 (list 10 -3. 2)) (define (fn-for-lon lon) (cond [(empty? lon) ()] Design a function that
5112
CPSC 110 Lecture Notes - Lecture 15: Finding Nemo Submarine Voyage, Backtracking, The Lego Group
;; complete the design of the data definition below to represent an attraction. ;; each unit has a name, a ticket price, a list of stores, and a list o
762
CPSC 110 Lecture Notes - Lecture 16: Empty String, Doberman Pinscher, Border Collie
;; problem 1: refactor this function to use built in abstract functions. (@htdf keep-positive) (@signature (listof integer) -> (listof integer)) ;; pro
6224
CPSC 110 Lecture 17: CPSC 110
;; region data definition provided. (@htdd region) (define-struct single (label weight color)) (define-struct group (color subs)) ;; single regions hav
5116
CPSC 110 Lecture Notes - Lecture 18: Quicksort, Cantor Set
;; this example will look at a way to sort a list of numbers. ;; the strategy of this algorithm is to first make the problem smaller by. ;; breaking it
3201
CPSC 110 Lecture Notes - Lecture 19: Backtracking
;; in this problem you will design a program to check whether a given simple. Note that you are operating on very simple mazes: ;; - all of your mazes
394
CPSC 110 Lecture 20: CPSC 110
Problem: (a) consider the following function that consumes a list of numbers and produces the sum of all the numbers in the list. Use the stepper to an
2137
CPSC 110 Lecture Notes - Lecture 21: Binary Tree, Arity, Backtracking
Use an accumulator to complete the design of the function count presented below so that it is tail-recursive. (@htdf count) (@signature (listof number)
9570
CPSC 110 Lecture Notes - Lecture 22: Arity, Binary Tree, Tail Call
(require spd/tags) (@htdd tree) (define-struct node (name subs)) [else ( (fn-for-t (first lot)) (fn-for-lot (rest lot)))]))] (fn-for-t t))) ;; todo is
11169
CPSC 110 Lecture Notes - Lecture 23: Backtracking
;; consider the following visualizations of a rail network. ;; has a name, number of platforms, and is wheelchair accessible or not. ;; - liv has 8 pla
9125
CPSC 110 Lecture Notes - Lecture 24: Backtracking
;; to travel that road to the destination city (@htdd city) (define-struct city (name roads)) ;; interp. a city with a name and roads leading out of th
4122
CPSC 110 Lecture Notes - Lecture 25: Foreach Loop, American Broadcasting Company, Natural Number
(require 2htdp/image) (require spd/tags) (@signature (listof number) -> number) [else (+ (first lon) (sum1 (rest lon)))])) (@template use-abstract-f
5217
CPSC 110 Lecture Notes - Lecture 26: Backtracking
We will design a program to check whether a given maze is solvable. Remember that we are operating on mazes with the following conditions: All of the m
5276