Improve this recursive code please!

Steven Taschuk staschuk at telusplanet.net
Tue May 6 14:37:26 EDT 2003


Quoth I:
  [...]
> So, instead of assigning bricks one by one, let's try assigning to
> the bins one by one.  Something like this:
  [...]
>         else:
>             # Only one bin left; put all remaining bricks there.
>             bins.append(bricksleft)
>             print tuple(binsbuilt)

Bug: need
            bins.pop()
at the end of that else clause.

-- 
Steven Taschuk                                7\ 7'Z {&~         .
staschuk at telusplanet.net                        Y r          --/hG-
                                            (__/ )_             1^1`





More information about the Python-list mailing list