searching numbers with linear and binary algorithms in java