













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Jamin; Class: Data Struct&Algor; Subject: Electrical Engineering And Computer Science; University: University of Michigan - Ann Arbor; Term: Fall 2007;
Typology: Assignments
1 / 21
This page cannot be seen from the preview
Don't miss anything!














Recurrence relations โ^
Recursive functions โ^
โ^
Unit testing โ^
Refactoring โ^
Pair Programming โ
โ^
โ^
PowerRaiser::PowerRaiser(
unsigned
int
base
)
:
base_( base ) { } unsigned
int
PowerRaiser::getBase()
const
{
return base_; } unsigned
int
PowerRaiser::raise(
unsigned
int power ) const {
if
(
0
==
number
)
{
return
1;
} else {
return
base_
raise(
power
1
);
class
PowerRaiserTest
{
public:
void
runAllTests(); void
testGetBase(); void
testGetPower(); ...
โ^
โ^
โ^
โ^
โ^
โ^
17
void
myFunction(
int*
ary,
unsigned
int
arySize
for
unsigned
int
i
0; i
arySize;
++i
ary[
i
do
some
stuff
here
for
unsigned
int
i
0; i
arySize;
++i
ary[
i
do
some
stuff
here
if
myBool
for
unsigned
int
i
i
arySize
++i
ary[
i
else
for
unsigned
int
i
arySize
i <
arySize;
++i
ary[
i
int*
ary, unsigned
int
startIdx,
unsigned
int
endIdx,
int operand ) {
for
unsigned
int
i
startIdx;
i
endIdx;
++i
ary[
i
operand;
} void
myFunction(
int*
ary,
unsigned
int
arySize
doIterativeOp(
ary,
arySize,
...doIterativeOp(
ary, 0,
arySize,
...doIterativeOp(
ary,
arySize
myBool