CS 410/584 Algorithm Design & Analysis Homework Assignment - Spring 2009 - Prof. David E. , Assignments of Computer Science

This json object represents the cs 410/584 algorithm design & analysis homework assignment from spring 2009. Instructions, reading materials, and exercises for the assignment. Students are expected to work alone but can discuss problems on the class mailing list. The assignment is due at the beginning of class on june 3, 2009. Exercises include implementing fft algorithm, finding all occurrences of a pattern in a text with preprocessed character position lists, and determining if four given points form a square without using division or square root.

Typology: Assignments

Pre 2010

Uploaded on 08/16/2009

koofers-user-6mg-1
koofers-user-6mg-1 🇺🇸

5

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework Assignment #5
CS 410/584 Algorithm Design & Analysis: Spring 2009
This assignment is due Wednesday, 3 June, at the beginning of class. You should work
alone on this assignment. However, you are free to discuss the problems on the class
mailing list. (Or you can send me email questions directly; please put “CS 584” at the
beginning of the subject line.) Please put “410” or “584” on your paper, depending on
which section you are registered in.
Reading: Chapters 33 and 34 all, 35.1
Note: On any homework exercise where you are asked to give (or modify) an algorithm,
you must also provide an English description of how it works and at least one example
execution.
Exercises: 30.2-2 (5 points; show the results of the recursive calls of FFT.), 33.1-5 (15
points), 33.2-3 (15 points), 33-3 (20 points. 584 only).
5A (15 points): This question concerns string matching. Suppose a text string has been
preprocessed to create a sorted list of positions of each character in the string. For
example
“this is a test text”
would have the lists
a: 9
e: 12, 17
h: 2
i: 3, 6
s: 4, 7, 13
t: 1, 11, 14, 16, 19
x: 18
blank: 5, 8, 10, 15
Give an efficient algorithm for finding all occurrences of a pattern in the text if such lists
exist for the text. Hint: Exploit the sorted order of the lists.
5B (10 points): Given four distinct points, give an algorithm to determine if they are the
corners of a square. Do not use division or square root.

Partial preview of the text

Download CS 410/584 Algorithm Design & Analysis Homework Assignment - Spring 2009 - Prof. David E. and more Assignments Computer Science in PDF only on Docsity!

Homework Assignment

CS 410/584 Algorithm Design & Analysis: Spring 2009

This assignment is due Wednesday, 3 June, at the beginning of class. You should work alone on this assignment. However, you are free to discuss the problems on the class mailing list. (Or you can send me email questions directly; please put “CS 584” at the beginning of the subject line.) Please put “410” or “584” on your paper, depending on which section you are registered in.

Reading: Chapters 33 and 34 all, 35.

Note: On any homework exercise where you are asked to give (or modify ) an algorithm, you must also provide an English description of how it works and at least one example execution.

Exercises: 30.2-2 (5 points; show the results of the recursive calls of FFT.), 33.1-5 ( points), 33.2-3 (15 points), 33-3 (20 points. 584 only).

5A (15 points): This question concerns string matching. Suppose a text string has been preprocessed to create a sorted list of positions of each character in the string. For example “this is a test text” would have the lists a: 9 e: 12, 17 h: 2 i: 3, 6 s: 4, 7, 13 t: 1, 11, 14, 16, 19 x: 18 blank: 5, 8, 10, 15

Give an efficient algorithm for finding all occurrences of a pattern in the text if such lists exist for the text. Hint: Exploit the sorted order of the lists.

5B (10 points): Given four distinct points, give an algorithm to determine if they are the corners of a square. Do not use division or square root.