University of Nevada Las Vegas
Howard R. Hughes College of
Engineering
School of Computer Science
My Home Page
UNLV CSC 302 Fall 2013 Assignment 1

CS 302 Assignment 1
Due date: Tuesday, January 29, 2013, 10:00 PM in class.
All written assignments must be handwritten
(not typed or printed from a
computer file) in your own handwriting, on 8.5 by 11 inch paper, or on A4
paper. Write your name on each sheet, and do not fold the pages or crimp the
corners. (You may use a paper clip or a staple.)
Turn the pages in to me or to the graduate assistant on the due date.
Work
Problem 2.7 on page 64 of your textbook.
For each of the six code fragments:
-
Guess the asymptotic complexity of sum,
in terms of n.
-
Run the code on a computer, with
n=10,
n=100, and
n=1000.
-
Make a table showing values of sum for each
value of n.
-
Revise your guess, based on those outputs.