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.
2-2 Correctness of bubb
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
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=
;CS 211 Programming Assingment 2
;Function asks if the input being given is an atom.
(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
in the rafters in the back room
swiss army knife
in the knife case by the office
on the ramp by the front door
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),