We all have made mistakes once a while. I have not
visit any book store lately, but try to locate Java
Examples In a NutShell 2nd Ed(Flanagan) and Java How
to Program 4th Ed(Deitel & Deitel). Each have its own
pro and con. Both books will provide you plenty of
code examples, the con side Flanagan's is written in
the 1.3 version and required you have some OOP
background while Deitels' book explanation is rather
strange to follow. If something hard to understand
turn on your API for explanation.
Now for the Algorithm, could you figure out yet or at
least jog it down in human language and post it here?
I am sure some of us have time will help you out
because your situation is very strange.