finalexamcs1 - COP 3502 Computer Science I Final Exam...

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

View Full Document Right Arrow Icon
COP 3502 – Computer Science I Final Exam – 7/28/08 (Monday) Name : ______________________________ 1) a) (3 pts) Convert 10110111 2 to decimal. ______________________ b) (3 pts) Convert 113 10 to binary. ______________________ c) (4 pts) Determine the following sum in terms of n: = - n n i i 2 1 2 , for positive integers n. _______________________
Background image of page 1

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

View Full DocumentRight Arrow Icon
2) (10 pts) Write a recursive function that takes in an integer array, its length, and a number, and determines the how many times the number appears in the array. Fill in the prototype given below. int numTimes(int values[], int length, int number) { } 3) a) (5 pts) An algorithm runs in O( n ) time. When the algorithm is run with an input size of 14900, it takes 7 seconds to complete. How long will it take to complete on an input size of 59600?
Background image of page 2
b) (5 pts) What is the (worst-case) run-time of the following segment of code in terms of n? Assume all variables are declared and initialized as integers. Please give a Big-Oh bound and a proper justification for your answer. for (i=0; i<n; i++) {
Background image of page 3

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

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

This note was uploaded on 09/22/2010 for the course EECS COP 3502 taught by Professor Guha during the Spring '09 term at University of Central Florida.

Page1 / 9

finalexamcs1 - COP 3502 Computer Science I Final Exam...

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

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