A couple of months ago I came across a wonderful resource Project Euler.
Project Euler is a set of mathematical problems that you are invited to solve at least programmatically, at least on paper.
To participate in the project, you need to go through a quick registration, after which you can safely storm the algorithms.
in detail - inside
The highlight of the
resource is that you can solve the problem in any language convenient for you, you just need to enter the correct answer in the form.
After the answer is given, you can enter the forum thread on this task and see what methods this task was solved by the other participants, who have accumulated a huge amount during the project (So far 29276 users have 537919 correct solutions; per user).
')
You can see how this problem was solved in almost all living programming languages, see beautiful solutions and coarse bruthofors)
As you progress through the complexity of tasks increases.
Compete with the speed of the algorithm and just discuss the mathematical aspect of the problem.
Extracts from statistics:tongue | number of participants |
C / C ++ | 3726 |
python | 2900 |
Java | 1782 |
C # | 917 |
Assembler | 37 |
F # | 97 |
Haskell | 945 |
Fortran | 32 |
Nemerle | eight |
Ada | sixteen |
R | 7 |
Prolog | 2 |
Boo | 6 |
Php | 425 |
Pencil / Paper | 291 |
Ruby | 804 |
So, for example, the very first task out of 200 pieces looks like:
Add all the natural numbers below one thousand that are multiples of 3 or 5.
This is the 50th
Which one of the most consecutive primes?
100ya
The terms of a given sequence.
Have a good dive