Homework Assignments
Homework 1: Page 22 13, Page 67 1-6
Homework 3: Page 107 #1,5,7 Page 192#9 Plus the
algorithm runs given in class.
Homework 4: Prove the following are true about Ackerman's function,
where
Ackerman's function A(m,n) is defined by:
A(0,n)=n+1
A(m,0)=A(m-1,1)
A(m,n)=A(m-1,A(m,n-1)) if m>0 and n>0
1. A(1,n)=n+2
2. A(2,n)=2n+3
3. A(3,n)=2n+3-3
4. A(4,n)=2 raised to itself n+3
times - 3
Also find the shortest path from node A to all other nodes in the graph
from the quiz
using Djikstra's algorithm. Show all steps.
Also find the shortest paths between all nodes in that graph using the
All-Pairs
shortest path algorithm.
Homework 5: Compute the all-pairs shortest paths for the graph with the
following adjacency matrix:
Edge/Edge
|
0
|
1
|
2
|
3
|
0
|
0
|
2
|
17
|
5
|
1
|
2
|
0
|
3
|
12
|
2
|
17
|
3
|
0
|
100
|
3
|
5
|
12
|
100
|
0
|
Find the optimal binary search tree for values 0,1,2,3,4 if they have
probabilities (0.05,0.15,0.4,0.1,0.3), respectively.