An introduction to algorithms in java