exam1key - PIC 10B EXAM 1 NAME_KEY PLEASE PRINT Check your...

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

View Full Document Right Arrow Icon
PIC 10B EXAM 1 April 23, 2007 NAME: ____________ KEY ______________________ PLEASE PRINT Check your TA's name: Hengli (9:00) ________ Faizal (10:00) ________ You have 50 minutes to complete this exam. No books, notes, or calculators are allowed. Show all work. Incomplete, illegible, or unintelligible answers may receive no credit. There are a total of 50 points on this exam. PAGE POSSIBLE POINTS SCORE 1 14 2 16 3 10 4 10 TOTAL 50
Background image of page 1

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

View Full DocumentRight Arrow Icon
1 1.) [4 points] Write the order of the following running times T using Big O Notation. 3 2 N T = O(N 3 ) 2500 100 3 2 + + = N N T O(N 2 ) N N T 2 20 + = O(2 N ) N N N T log 5 100 + = O(N logN) 2.) a.) [4 points] List "The Big Four" member functions. Default Constructor Copy Constructor Assignment operator= Destructor b.) [2 points] Luke wrote a class Clown that does not use dynamically allocated memory. Is it necessary for Luke to include The Big Four in his Clown class? Why or why not? No. The copy constructor, assignment operator, and destructor are generated automatically by the compiler for classes without dynamic arrays. The default constructor is always optional, though usually a good idea. The declaration of the IntMatrix class is given on the last page of this exam for reference. 3.) [4 points] In the IntMatrix class you wrote for HW2, you defined two versions of the subscript operator( ). Why? Give an example of when each version would be used. One version is for looking up the value, the other is for changing the value.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This test prep was uploaded on 04/23/2008 for the course PIC 10B taught by Professor Wittman during the Spring '08 term at UCLA.

Page1 / 6

exam1key - PIC 10B EXAM 1 NAME_KEY PLEASE PRINT Check your...

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

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