4 ms·
Thanks . Yeah with Python , there wont be any problem with the type, but i'm learning java , and i'm solving project euler problems and as you know the numbers
by teja1990 15y ago
Thanks .
Yeah with Python , there wont be any problem with the type, but i'm learning java , and i'm solving project euler problems and as you know the numbers they give are pretty big , for instance consider a 1000 digit number , in python u just type a= number, but in java we use string and then use Charater.digit with String.charAt , i guess u understand my problem , today i was stuck up conversion of string to int array , these things really consume time , and logic i dont take much time , its just these things , this is sounding little rude , but ireally didnt mean to be , i'm just frustrated..
- sgentle 15y agoNot at all - I understand. One of the most important skills to have as a programmer is choosing the right tool for the right job. That's not to say Java can't do what you want, but you might find it's better designed for tackling large abstract problems than algorithmic and mathematical ones. For example, check out this list of people who have completed 250 or more problems (only works if you're logged in): http://projecteuler.net/index.php?section=scores&show=veterans http://projecteuler.net/index.php?section=scores&show=ve... Correlation isn't causation and all that, but this shows you the tools that the people who finish all the problems want to use are, in order, C/C++, Python, Java, and Mathematica. In the end, though, it's really a question of what your goal is. If you want to learn Java, then learn Java (but I would consider learning it using problems better suited to it). If you want to solve Project Euler problems, you'll have your work cut out for you just figuring out good algorithms; it's best to do it in the language that will give you the least trouble. Incidentally, while Python automatically turns large numbers into digit arrays, if you stick with Java you might find its equivalent BigInteger class useful: http://download.oracle.com/javase/1,5.0/docs/api/java/math/BigInteger.html http://download.oracle.com/javase/1,5.0/docs/api/java/math/B...
- teja1990 15y agoThanks sam, i guess i'll use python to solve Proj Euler and thanks alot for your time :)