SER222
Problem Set 1
2.1
a. O(n2)
b. O(n3)
c. O(2n)
d. O(n2logn)
2.4
Growth Function:
()n2
Order:
O(n2)
2.5
Growth Function:
n(logn)
Order:
O(nlogn)
2.6
public int[][] table() cfw_
int[][] table = new int[10][4];
int[] dishes = new int[]cfw_1,2,5,10,100,1

SER222
Problem Set 3
6.1
4 added to X
7 added to X
Y contains 4
3 added to X
2 added to X
5 added to X
7 is removed from X
7 is already removed
9 is added to X
2,3,4,5,9
6.2
a. 9
b. True
2
c. 2 is removed
3
6.3
O(n)
6.5
The rear reference is 0 if the queu

SER222
Problem Set 2
4.1
If the diagram is set to reverse order, the referencing will be thrown off. The front
node and the remaining nodes will lose connection.
4.2
If the diagram were set to reverse order, the reference to the current node would
be set

Brandon Barba
6089-750
SER222
Problem Set 4
8.2
! ! = ! ! !
8.4
! ! = ! ! 1 + !(! 2)
Recursion would not work because computations would be repeated.
8.6
public int factorial (int N)
cfw_
int answer;
if (N = 1) cfw_
answer = 1;
else cfw_
answer = N * fac