Kimberly Dame
CS 305 Assignment 1 (35pts) Due July 5, 10:30am in class
1. (14pts) Correctness of bubblesort (Problem set 2-2 in textbook). You only need
to choose one of part b) and part c) to prove.
a. 3pts
b. 7pts
c. 7pts
d. 4pts
2-2 Correctness of bubb
Kimberly Dame
CS 305 Assignment 2 (35pts) Due July 17, 10:30am in class
Feel free to choose one of problem 2 and problem 3 to work on.
1. (20pts) Let A[1 . n] be an array of n distinct numbers. If i < j and A[j] > A[j], then the
pair (i, j) is called an i
CS 211
Spring 2011
Submit Answers in type set form.
1. (5 points) Consider the following committee membership rules:
1. The Financial Committee must be chosen from among the General Committee.
2. No-one shall be a member of the General and Library Committ
1. For each of the elements in A which is the intersection of E and F, a typical
element proof would be:
X E F X E and X F X (E) (F)
It would be surjective because not everything in A points to B
2. To prove this statement:
Say that E = cfw_ 1 2 3 and F=
;Kimberly Dame
;CS 211 Programming Assingment 2
#lang racket
;Function asks if the input being given is an atom.
(define atom?
(lambda (a)
(not (list? a)
;function flattens a list such that if (a(b(c(a) is the list, the flattened
looks like this (a b c a)
ben and jerrys ice cream
in the freezer on the front wall
3.29
89
scythe handle
in the rafters in the back room
42.55
1
swiss army knife
in the knife case by the office
19.99
11
motor oil
on the ramp by the front door
2.49
110
waterproof matches
at the fr
Answers to HW 3:
1. The sequence of operations have log2(n) numbers with an exact power of 2. The total
cost of the operation is the sum of all log2(n) powers of 2 and the n-log2(n) other numbers
which are just 1. The cost of each of the initials is O(n),