CSC 344
Homework 1

Assigned 20 Jan, due 3 Feb

Problems from chapter 1 of the textbook
Another pseudocode problem:

Write an algorithm in pseudocode which takes in a list (or array or whatever) of n numbers, and determines whether or not there is a number that appears more than once in the list. For example, dups(3,8,5,1,6) would return false, but dups(3,8,5,3,6) would return true.

Analyze your algorithm's running time as a function of n. Hint: the problem can be solved in time proportional to n*log(n); for full credit, give an algorithm of this efficiency or better.

Programming:

Write an algorithm in pseudocode which takes in two binary numbers (represented as lists or arrays of booleans) and adds them, producing the result as another list or array of booleans.

Implement, test, and debug your binary-addition algorithm in your favorite programming language -- C, C++, Java, Scheme, Prolog, perl, Pascal, etc.


Last modified: Thu Jan 20 09:13:26 EST 2005
Stephen Bloch / sbloch@adelphi.edu