The jump past the root
transcript
Jump k replies up a thread. The root points at itself. That keeps jumps inside the table. Does it give the right answer?
Message three replies to message two. Two replies to one, and one to zero. Message zero starts the thread. So the thread has four messages.
Ask for four steps from message three. The thread has only three steps. The table returns zero. That is wrong.
The root points at itself. So the jump never leaves it. Extra steps are silently ignored. The thread had ended long before.
Add one node past the last. Point every missing parent at it. Report minus one when a jump lands there. Now deep jumps are right.
Test a jump of exactly the depth. Test one step more than the depth. Test a jump far beyond the depth.
A root that repeats hides the end. A sentinel marks the end. Test jumps past the root. Full breakdown in the lecture.