Filter By
Filter Reset
Semester
Class Notes (1,044,190)
CA (598,535)
UBC (14,949)
CPSC (207)

Class Notes for Computer Science at University of British Columbia

CPSC 110 Lecture Notes - Lecture 26: Backtracking
24HR
Premium

(require spd/tags) Let's revisit the maze problem. 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 maze...

Computer Science
CPSC 110
Anthony Estey
CPSC 110 Lecture Notes - Lecture 25: Foreach Loop, American Broadcasting Company, Natural Number
24HR
Premium

(require 2htdp/image) (require spd/tags) (@signature (listof Number) -> Number) ;; produces the sum of a list of numbers (check-expect (sum1 empty) 0) (check-expect (sum2 empty) 0) (check-expect (sum3 empty) 0) (check-ex...

Computer Science
CPSC 110
Anthony Estey
CPSC 110 Lecture Notes - Lecture 24: Backtracking
24HR
Premium

(require spd/tags) ;; Consider the following road map. The letters are the names of cities, ;; the arrows are one-way roads. The numbers indicate how long it takes ;; to travel that road to the destination city ...

Computer Science
CPSC 110
Anthony Estey
CPSC 110 Lecture Notes - Lecture 23: Backtracking
24HR
Premium

(require spd/tags) ;; Consider the following visualizations of a rail network. Each train station ;; has a name, number of platforms, and is wheelchair accessible or not. ;; ;; For example: ;; - LIV has 8 platforms and i...

Computer Science
CPSC 110
Anthony Estey
CPSC 103 Lecture Notes - Lecture 12: Bar Chart, Histogram
24HR
Premium

Bar Chart 1. Example 1:design a function that display a bar chart. This chart is showing the result s of a made-up test for people in different age groups 2. We can also create two bar charts on the same plot. In this case...

Computer Science
CPSC 103
Steve Wolfman
CPSC 103 Lecture 11:
24HR
Premium

1. Design a function that will take a list of floats that represent historical stock prices and create a line chart to show the stock prices over time. Weve provided a data definition for a list of floats, some sample data...

Computer Science
CPSC 103
Steve Wolfman
CPSC 110 Lecture Notes - Lecture 22: Arity, Binary Tree, Tail Call
24HR
Premium

(require spd/tags) (@HtDD Tree) (define-struct node (name subs)) ;; Tree is (make-node String (listof Tree)) ;; interp. a bare bones arbitrary arity tree, each node has a name and subs (define L1 (make-node "L1" empty)) ...

Computer Science
CPSC 110
Anthony Estey
CPSC 110 Lecture Notes - Lecture 21: Binary Tree, Arity, Backtracking
24HR
Premium

(require spdtags) PROBLEM: Use an accumulator to complete the design of the function count presented below so that it is tail-recursive. (@HtDF count) (@signature (listof Number) -> Number) ;; produce the number of element...

Computer Science
CPSC 110
Anthony Estey
CPSC 103 Lecture Notes - Lecture 10: Scatter Plot
24HR
Premium

1. Writea function that takes a List [GraduationData] and shows a line chart that plots the percentage of psychology bachelor degrees that were earned by women between 1970 2011.

Computer Science
CPSC 103
Steve Wolfman
CPSC 103 Lecture 9: Lecture 9
24HR
Premium

1. HtDAP recipe a. Planning - Identify the information in the file your program will read - Write a description of what your program will produce - Write or draw examples of what your program will produce b. Building the p...

Computer Science
CPSC 103
Steve Wolfman
CPSC 103 Lecture Notes - Lecture 8: Domain Knowledge
24HR
Premium

1. Helper Rules In general, you should create a helper function wheneverpart of a function you are designing seems tobe a well-defined subtask. You should create a helper function for the subtask and call the new helper fu...

Computer Science
CPSC 103
Steve Wolfman
CPSC 103 Lecture 7: lecture 7
24HR
Premium

1. Design a data definitiontorepresent a list ofi ntegers 2. Design a function that calculates the sum of all the integers in a list

Computer Science
CPSC 103
Steve Wolfman
CPSC 103 Lecture 6: lecture 6
24HR
Premium

1. Animal Example 2. Arbitrary-Sized Data Whenwe have informationof unknown size, we create a data definitionthat canhold arbitrary-sized data. Note that arbitrary means unknown, not infinite orlarge. Some examples of ...

Computer Science
CPSC 103
Steve Wolfman
CPSC 110 Lecture 20: CPSC 110
24HR
Premium

(require spd/tags) ;; sum-tr-starter.rkt 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 analyze t...

Computer Science
CPSC 110
Anthony Estey
CPSC 110 Lecture Notes - Lecture 19: Backtracking
24HR
Premium

(require spd/tags) ;; In this problem you will design a program to check whether a given simple ;; maze is solvable. Note that you are operating on VERY SIMPLE mazes: ;; - all of your mazes will be square ;; - all maz...

Computer Science
CPSC 110
Anthony Estey

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit