COS 554 SPRING 2009 HW #1 DUE TUESDAY 1/20/09 p. 13: 1-1, 20 points p. 27: 2.2-2, 20 points p. 37: 2.3-5, 20 points p. 39: 2-4, 20 points p. 58: 3-3, 20 points ********** Problem Notes *********, Any time that the problems ask you to write pseudo-code, I want you to write working programs. The programs should include some representative data and be easy to read and should include comments. You can add comments to Logo programs using ";". Unless explicit language requirements are stated, you may use either of the four languages C, Pascal, LISP or Logo in this course. For many short problems, Logo will be the fastest language for coding. As noted in the syllabus, I expect programs to come with printed source code and printed sample output. The source code should be comprehensible and contain comments. p. 13: 1-1. Give some indication of how you got your results. p. 27: 2.2-2. Write a recursive program to produce a selection sort. Use the recursive program to derive the various bounds. p. 36: 2.3-5. Write a recursive program to produce a binary search. Use the recursive program to derive the various bounds. p. 39: 2-4. Write a recursive program that will compute the number of inversions in a permutation in time Theta(n lg n). Prove that the program performs as stated. p. 58: 3-3. Give some reasons for your answer.