# CS1030901s - Computer Science Foundation Exam March 9, 2001...

This preview shows pages 1–3. Sign up to view the full content.

Computer Science Foundation Exam March 9, 2001 Section I A solutions

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

View Full Document
4 (1, 20%) a) Show the array X after the procedure has completed execution (2pts each)? Array X 15 12 5 7 11 17 position 123456 b) What value will the variables a and b contain when the algorithm is finished (4pts each)? a 9 b 8 (2, 14%) a) 7 2 4 - 3 A * 5 + 8 B 4 / * 6 C + - = 3 b) output from print statements: 2734 first output second output third output fourth output (3, 20%) a) For an O(n!) algorithm, one data set with n = 4 takes 72 seconds. How long will it take for a data set with n = 5 ? 360 seconds b) For an O(2 n ) algorithm, one data set with n = 7 takes 96 seconds. If you used a different-sized data set and it took 12 seconds, how large must that data set be? n = 4 c) For an O(n 3 ) algorithm, a friend tells you that it took 192 seconds to run on her data set. You run the same program, on the same machine, and your data set with n = 6 takes 648 seconds. What size was her data set? n = 4 d) What is the Order of this pseudocode segment?
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 09/21/2011.

### Page1 / 5

CS1030901s - Computer Science Foundation Exam March 9, 2001...

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

View Full Document
Ask a homework question - tutors are online