Lab4-AlgAnalysis - Computer Science I Summer 2011...

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

View Full Document Right Arrow Icon
Computer Science I – Summer 2011 Recitation #4: Algorithm Analysis Spend no more than THREE minutes each on the next four questions (12 min total). Directions: For questions 1 – 4, utilize the technique shown in class of setting up an equation with a constant, solve for that constant, and then answer the given question. 1) For an O(n 3 ) algorithm, one data set with n = 3 takes 54 seconds. How long will it take for a data set with n = 5? 2) For an O(2 n ) algorithm, a friend tells you that it took 17 seconds to run on her data set on a O(2 n ) algorithm. You run the same program, on the same machine, and your data set with n = 7 takes 68 seconds. What size was her data set? 3) For an O(N k ) algorithm, where k is a positive integer, an instance of size M takes 32 seconds to run. Suppose you run an instance of size 2M and find that it takes 512 seconds to run. What is the value of k? 4) Assume that an O(log
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/21/2011 for the course COP 3330 taught by Professor Staff during the Spring '08 term at University of Central Florida.

Page1 / 2

Lab4-AlgAnalysis - Computer Science I Summer 2011...

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