I've been using Project Euler as practice. Project Euler is a list of math/programming problems. Most of them would be either extremely difficult or exceedingly time-consuming to solve by hand, whereas an efficient algorithm can solve each problem rather quickly. At least for the early problems, the good solutions take less than a second to finish.
When you solve a problem, the website gives you access to a forum where you can see how other people solved problems. Some of the top solvers use a language called J which looks really, really cryptic, even for simple operations. For example: “c=:%:@:(+/)@:*:” creates a formula for the Pythagorean Theorem. Many of the statements just look like someone going to town on the top row of the keyboard. But it's a really powerful little language, and I've been trying to get the hang of it for the past three or four days.
Well, Project Euler's Problem 29 gave me some trouble because I misread it. The question is “How many distinct terms are in the sequence generated by ab for 2
Oh well. The nice thing about math is that when you solve the harder problem, you usually learn enough that it doesn't even feel like a waste of time.
2 comments:
I'm partial to C++, but Java is close enough that it doesn't really matter. It all depends on your purpose. If you want easy to code, then maybe try Python. Java is pretty good as far as portability across platforms goes. However, for serious speed, you gotta go with C/C++. However, however, if you are doing number crunching you might want to look at Fortran. It's old, but it does its thing.
But once you learn one, they all kind of fall into line.
I did C++ back in high school for AP Computer Science. If I start to run into speed problems, maybe I'll go back to it. To this point, everything's pretty simple once I figure out the right way to do it.
I've never used Fortran or Python. I'll keep 'em in mind. Thanks for the recommendations.
Post a Comment