Dear X,
        U can do it very easily.
        Just consider root as parent
       Now start from parent go to child
      Now consider child as parent and go on till u get no child .
         In case of any problem do mail me at [EMAIL PROTECTED]
 


 
On 2/7/06, sam <[EMAIL PROTECTED]> wrote:

Hi,
Not sure I'm on the right forum for that, but here we go. I have a
problem writing an algorithm for doing what I want.
I have two simple SQL table that I need to show you in order to explain
my problem:

[Query] (QueryId, QueryName)
[QueryLink] (QueryLinkId, QueryId, LinkedQueryId)

Nothing spectacular. The [QueryLink] table allows linking two records
from the [Query] Table together (QueryId and LinkedQueryId).

Now I can build a whole tree like that. An example would be:

|-Query1
| |
| |-Query2
| |-Query3
|
|-Query2
| |
| |-Query3
|
|-Query4
| |
| |-Query3
|
|-Query3
| |
| |-Query5
|

gives:

Query1 -> Query2 -> Query3 -> Query5
Query1 -> Query3 -> Query5

Query2 -> Query3 -> Query5

Query4 -> Query3 -> Query5

Query3 -> Query5


How can I do a proper recursion to get to this pattern ?

Thanks



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to