-1, 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 12, 13, 14, 16, 16, 16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
A diagram of this structure is shown below, the answer to the problem for this structure is 7. Who should be called first, person 1 or person 2? Why?
minTime(0)
is
the answer to the APT problem.
subTimes
below, explain why
the call to sort shown is useful.
Node
and DNode
exist
as shown below. You'll write methods in a class LinkStuff
for your solutions. You'll snarf a skeleton version of the code to write
solutions in a group and then view them during recitation. You cannot
use instance variables, all variables must be local to the
methods you write.
Write the function makeReversed
whose header follows. The
function returns a list in which for each number
k in the range [1..n], there are k nodes containing
k, and the nodes are in reverse order: n, n-1, ..., 3, 2, 1
For example:
Write a return to move the node pointed to by parameter
list
to the front of a linked list and return a
pointer to list
which is now the first node of the
list. Be sure to update all links and watch out for special cases
of the first ndoe (nothing to do) and the last node (no node after
it).