Answer the question
In order to leave comments, you need to log in
Is a universal abstract algorithm of approach to solving non-trivial problems possible?
For example, there is a problem about the Towers of Hanoi .
One of the experienced programmers proposed a recursion solution to this problem: it is very elegant, and takes only 20-30 lines of complex Java code. But to understand what is happening there, inside, in recursion, is not so simple - that's why this is a recursive solution. But after all, this recursive solution was somehow approached, and the task is not trivial. Is there a general abstract algorithm for solving such unusual problems? Perhaps there is something like a plan: analysis, examination of the boundaries of the problem, etc.
So that in cases where a new unusual task arises, no time would be spent on wrong decisions, or less time would be spent.
Answer the question
In order to leave comments, you need to log in
Non-trivial problems are non-trivial because there is no general solution method for them. Usually you just need to look at the problem from the right angle so that the solution comes by itself!
In fact, the Tower of Hanoi is an example of a trivial problem, and it is almost always solved by recursion, according to the principle of induction - solving the problem of shifting N rings from rod A to rod C is shifting N-1 rings from A to B, 1 rings from A to C and N-1 rings from B to C.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question