- what are the "problem patterns" that call for the solution of
recursion
I wouldn't say there's such a thing like a problem pattern for the use of recursion. Every function that can be implemented with recursion can also be implemented iteratively, often by pushing and popping a stack.
It's a matter of expression and also of performance. Iterative algorithms often times have a better performance and are easier to optimize. However, recursive algorithms benefit from a clearer expression and thus are often easier to read, understand and implement.
Some things even cannot be expressed without recursion, infinite lists for example. The so called functional languages heavily rely on recursion, as it's their natural way of expression. The saying is: "Recursive programming is functional programming done right".
- is recursion a form of "divide & conquer" strategy or a form of
"code reuse" -- or, is a design pattern in its own right
I would not call it a design pattern. It's a matter of expression. Sometimes a recursive expression is simply more powerful and more expressive and thus leads to better and cleaner code.
- can you give us an example of a real world problem where
recursion comes to mind as an immediate solution
Anything that needs to traverse trees will be properly expressed by a recursive algorithm.
A software stack generally refers to a set of technologies that work together to support the development, maintenance and operation of software. Stack in this context is a bit of a colloquialism and doesn't have an official definition, but often includes all software that is required for your solution (including the webserver, the OS, any special extensions like memcache etc, as well as developer tools like a tightly coupled platform/language/IDE). Sometimes, the definition might even extend to a hardware stack like Amazon's cloud computing services.
A framework has a more technical definition, and although the term is sometimes used interchangeably with library, a framework is usually distinguished by a property called Inversion of Control. Contrasted with a library, where methods are called by the programmer where needed, using a framework usually means that much of the application functionality is deferred to the framework, allowing the programmer to avoid writing boilerplate code and merely "fill in the blanks", leaving the framework to decide when its appropriate to execute core business logic.
Middleware is a bit more esoteric, but often refers to software or an application interface built to facilitate standard communication between complex systems. You can expect middleware to perform tasks like parsing, authentication or just provide a standard way to communicate data between systems. Contrasted with a library or framework, middleware is generally not considered a "developer tool" per-say and tends to be pretty tightly integrated into the systems it facilitates.
Best Answer
The context of the two terms is generally different.
Self referencing is in the context of data -- you have a data type that contains a reference to something of the same type.
Recursive is in the context of code -- you have a function or procedure that calls itself.
Example: