Sale!

# Assignment 6B Skills Big-Oh Analysis

\$30.00

Category:

CSC 230 Elementary Data Structures and Algorithms
– Assignment 6B

Assignment 6B Skills
Big-Oh Analysis
Assignment 6B Background
For this assignmnet you will be analyzing several algorithms to determine their running-time efficiency
in terms of Big-Oh.
Assignment 6B Requirements
Provide a Big-Oh analysis for each of the following code segments.
1.)
a = 5 ;
b = 3 ;
c = a ∗ b ;
2.)
for ( i =0; i<n ; i++) {
a+=1;
}
3.)
for ( i =0; i<n ; i++) {
a+=i ;
}
4.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
a+=1;
}
}
5.)
for ( i =0; i <(n / 2 ) ; i++) {
a+=i ;
}
6.)
for ( i =0; i<n ; i++) {
a+=1;
}
for ( j =0; j<n ; j++) {
a+=1;
}
7.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
a+=1;
}
}
for ( k=0; k<n ; k++) {
a+=1;
}
8.)
for ( i =0; i<n ; i++) {
for ( j =0; j<n ; j++) {
for ( k=0; k<n ; k++) {
a+=1;
}
}
}
9.)
i f ( x==2) {
y=3;
} e l s e {
y=0;
}
10.)
i f ( x==0) {
y=0;
} e l s e {
for ( i =0; i<n ; i++) {
y+=1;
}
}
Assignment 6B Submission Submit in class:
A hardcopy of your analysis. You must show all work.
Required Each submitted file should include your name and a statement that this is your own work.

## Reviews

There are no reviews yet.