Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Kent Johnson
rh0dium wrote: > Hi all, > > I need some help on writing a recursive priority function > > Given a list = [ A, B, C, D] > > Where the following constraints are in place: > > A depends on [B, C] > C depends on [B] > > Figure out real order that prioritizes these. You need a topological sort. h

Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Arnaud Delobelle
On Jan 21, 10:30 pm, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > I need some help on writing a recursive priority function > > Given a list = [ A, B, C, D] > > Where the following constraints are in place: > > A depends on [B, C] > C depends on [B] > > Figure out real order that prioritizes th

Re: Prioritization function needed (recursive help!)

2008-01-21 Thread Paul Rubin
rh0dium <[EMAIL PROTECTED]> writes: > I am really struggling on simply how to organize the data and write > the corresponding function - I tried classes but I don't know if > that's the best approach. See my other post on this. We just had a discussion thread about this. Is it a homework problem

Prioritization function needed (recursive help!)

2008-01-21 Thread rh0dium
Hi all, I need some help on writing a recursive priority function Given a list = [ A, B, C, D] Where the following constraints are in place: A depends on [B, C] C depends on [B] Figure out real order that prioritizes these. Output [ B, C, A, D ] is valid. (Actually D could be anywhere in it