{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw1 - Data Structures and Algorithms(CS 130A Prof Suri...

This preview shows page 1. Sign up to view the full content.

Data Structures and Algorithms (CS 130A) Prof. Suri Homework Assignment 1 Handed Out: Jan 6 Due: Jan 13 1. (10 pts) Suppose T 1 ( n ) = O ( g ( n )) and also T 2 ( n ) = O ( g ( n )). Which of the following are true? Explain your answer. (a) T 1 ( n ) + T 2 ( n ) = O ( g ( n )). (b) T 1 ( n ) - T 2 ( n ) = o ( g ( n )). (c) T 1 ( n ) /T 2 ( n ) = O (1). (d) T 1 ( n ) = O ( T 2 ( n )). 2. (10 points) In a court order case, a judge cited a city for contempt and ordered a fine of \$10 for the first day. Each subsequent day, until the city followed the judge’s order, the fine was doubled. (That is, the fine progressed as follows: \$10, \$20, \$40, etc.) (a) (3 pts) What would be the fine on day N ? (b) (3 pts) Given a specific amount D , how many days would it take for the fine to reach D dollars? (A big-Oh answer will do.) (c) (4 pts) Suppose the judge were a bit harsher, and the fine was squared each day, instead of doubled. Then, what would be the fine on day N ? 3. (10 pts) You are given an N × N matrix of numbers, which is already in memory. The matrix is monotone in the following sense: in each row, the numbers are increasing from left to right; and in each column, the numbers are increasing from top to bottom.
This is the end of the preview. Sign up to access the rest of the document.
• Winter '11
• SURI
• pts, Analysis of algorithms, Computational complexity theory, time algorithm, maximum average subsequence, Prof. Suri

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern