Algorithm needs to be implemented in JAVA

Hi,

I need to implement this algorithm in JAVA. I tried to write half of the code But I stopped in the other half.

The algorithm:

Marking procedure at router R:
let R' = Bitlntereave(R, Hash(R))
let k be the number of non-overlapping fragments in R'
for each packet w
let x be a random number from [0..1)
if x < p then
let o be a random integer from [0..k - 1]
let f be the fragment of R' at offset o
write f into w.frag
write 0 into w.distance
write o into w.offset
else
if w.distance = 0 then
let f be the fragment of R' at offset w.offset
write f @ w.frag into w.frag
increment w.distance
Path reconstruction procedure at victim v:
let FragTbl be a table of tuples (flag,offset,distance)
let G be a tree with root v
let edges in G be tuples (start,end,distance)
let maxd := 0
let last := v
for each packet w from attacker
FragTbl.Insert(w.frag,w.offset,w.distance)
if w.distance > maxd then
maxd := w.distance
for d := 0 to maxd
for all ordered combinations of fragments at distance d
construct edge z
if d � 0 then
z := z @ last
if Hash(EvenBits(z)) = OddBits(z) then
insert edge (z,EvenBits(z),d) into G
last := EvenBits(z);
remove any edge (x,y,d) with d :fi distance from x to v in G
extract path (RI..Rj) by enumerating acyclic paths in G

Your help is appreciated.
Regards,
Moe:confused: