Seeking recursive solution to replace nested for-loops

From: Michelle Romano <mromano_at_sensis.com>
Date: 19 Feb 2004 09:19:28 -0800
Message-ID: <aaba7f35.0402190919.31edd67f_at_posting.google.com>



[Quoted] [Quoted] Working with PL/SQL and Oracle9i, I am looking for a better way to generate combinations of n objects taken k at a time:

    n!/k!(n-k)!
I am currently using the nested for-loop concept, but it is very inefficient since the value of k can vary.

Does anyone know of a recursive solution or a better iterative solution using PL/SQL? Even a code sample which demonstrates recursion would give me a good place to start.

Thanks in advance for your help.

Michelle Received on Thu Feb 19 2004 - 18:19:28 CET

Original text of this message