posted 5 years ago
hey guys,
im sort of new to java and im trying to write this complicated(for me) program..so basically given a number n,the the output is 2*function(n1)+function(n1)
for n=1,n=0 return 1 and o respectively.
And the constraint is that the value once computed should not be computed again that is all computed values should be stored and used the next time when the same calculation is done. so i tried to figure out TreeMaps and also generics. and i believe that i have the program obeying the conditions.
but the biggest value the program gives an output is 4250 after which an exception is thrown and its getMessage prints a null . i want to be able to give inputs till 10000.
I dont know why i did it..but i googled out the largest number datatype and coded using the BigInteger but the result is not correct better than Integer though.
Please tell my mistake.
hey guys,
im sort of new to java and im trying to write this complicated(for me) program..so basically given a number n,the the output is 2*function(n1)+function(n1)
for n=1,n=0 return 1 and o respectively.
And the constraint is that the value once computed should not be computed again that is all computed values should be stored and used the next time when the same calculation is done. so i tried to figure out TreeMaps and also generics. and i believe that i have the program obeying the conditions.
but the biggest value the program gives an output is 4250 after which an exception is thrown and its getMessage prints a null . i want to be able to give inputs till 10000.
I dont know why i did it..but i googled out the largest number datatype and coded using the BigInteger but the result is not correct better than Integer though.
Please tell my mistake.
The next generation Mordern iSeries Developer
brevity is the soul of wit  shakepeare. Tiny ad:
Rocket Oven Kickstarter  from the trailboss
https://coderanch.com/t/695773/RocketOvenKickstartertrailboss
