I have noticed many problems in algorithms textbook are solved by recursion (divide and conquer, backtracking,...)
As I tried to enhance my skills in writing them, I have noticed, I just need to translate a recursive definition of the problem to the code. Then I don't even need to know how it will be executed. I thought recursion may naturally belong to declarativefunctional programming style.
Actually I am new to functional or declarative programming (I just was studying some about them). Is it a good advice for students to think decorativelydeclaratively (think to relate the definitions rather how) when they want to write a recursive algorithm? Could it be a general rule for any recursive algorithm?
Beside, what is exactly the declarative approach to solve a problem (as it is in functional programming)?