CS 1713 Introduction to Computer Science, Spring 2006 Exam 2 Comments
Grade Distribution:
- 90-97: 1
- 80-89: 6
- 70-79: 3
- 60-69: 2
- 50-59: 3
- below 50: 1
- 1) Be careful of the difference between && and ||
- 2) There are many ways of doing this.
Remember that 0 is an even number because it is divisible by 2.
- 4) Remember that the second parameter of substring is the first index
not used.
- 6) Write a method here.
Do not print anything.
Return the index (position) of the maximum value, not the maximum value.
- 7b) Almost everyone got this right.
- 7c) Only one person got this right! The most common answer was 10.
Doubling the size of an array, multiplies the time for a selection
sort by 4. Tripling the size of an array multiplies the time by 9.
- 7d) Only three people came close to the correct answer.
If the original array has size 1024
(not particularly large), the it takes at most 10 times throught the
loop.
If you double the size of the array, it then takes 11 times,
or 10% more.
If the origianal array has size 1,000,000 it takes 20 times through the
loop. Doubling the size takes 21 times, a 5% increase in time.
- 9) 5 people (30%) did an insertion sort rather than a selection sort.