Assignment 2 problems - Assignment #2 Due Date: Wednesday,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 Assignment #2 Due Date: Wednesday, February 4 at 11:59pm Submit: WebCT Late Policy: -1 point per minute late Instructions: This is an individual assignment. Answers should be your own work. Chapter 2 5 pts 1. In the definition of Big-O, why is the "for N >= n0" needed? 5 pts 2. If f1(N) = 2N and f2(N) = 3N, why are they both O(N)? 5 pts 3. For f1(N) = 2N and f2(N) = 3N, compare the values f1(10) with f1(20) and f2(10) with f2(20). What do you notice in the comparisons? 5 pts 4. Since Big-O notation is a mathematical tool for functions like f(N) or g(N), how is it applicable to algorithm analysis? 5 pts 5. Which grows faster, 2^n or n! ? Why? 10 pts (2 each) 6. Give the Big-O notation for the following expressions: a. 4n^5 + 3n^2 - 2 b. 5^n - n^2 + 19 c. (3/5)*n d. 3n * log(n) + 11 e. [n(n+1)/2 + n] / 2 Questions 7-10 are 7 points each. Use the following declarations for questions 6-9. 7. What is the Big-O running time for this code?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/16/2009 for the course CS 3345 taught by Professor Ozbirn during the Spring '08 term at University of Texas at Dallas, Richardson.

Page1 / 6

Assignment 2 problems - Assignment #2 Due Date: Wednesday,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online