MRAB wrote:
> It's left as an exercise for the reader as to how it works. :-)
*if* it works, you mean. should the following script really print anything?
import random, sys
# input variables replaced with zeros
L = [
['b', ['w','z']],
['a', ['z','y']],
['w', ['z','0']],
['z
[EMAIL PROTECTED] wrote:
> I am trying to write some code that will take a list of functional
> expressions, and order them so that those with primitive terms appear
> at the beginning of the list and those that are defined by other terms
> appear last.
>
> eg:
> getSortedEquations(['b
Marc 'BlackJack' Rintsch wrote:
>> So I suspect that this is a common problem for those familiar with
>> partially ordered sets or directed graphs. I'm wondering if anyone else
>> is familiar with this problem and knows an efficient algorithm that
>> will solve it. It would be good if any such alg
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am trying to write some code that will take a list of functional
> expressions, and order them so that those with primitive terms appear
> at the beginning of the list and those that are defined by other terms
> appear last.
>
> eg:
>
In <[EMAIL PROTECTED]>, chrisguest
wrote:
> So I suspect that this is a common problem for those familiar with
> partially ordered sets or directed graphs. I'm wondering if anyone else
> is familiar with this problem and knows an efficient algorithm that
> will solve it. It would be good if any su