Popular recipes by Chris Smith http://code.activestate.com/recipes/users/2725752/2013-12-23T02:44:43-08:00ActiveState Code RecipesBell permutations using Even's nonrecursive algorithm (Python) 2013-12-23T02:44:43-08:00Chris Smithhttp://code.activestate.com/recipes/users/2725752/http://code.activestate.com/recipes/578792-bell-permutations-using-evens-nonrecursive-algorit/ <p style="color: grey"> Python recipe 578792 by <a href="/recipes/users/2725752/">Chris Smith</a> (<a href="/recipes/tags/bell/">bell</a>, <a href="/recipes/tags/johnson/">johnson</a>, <a href="/recipes/tags/permutations/">permutations</a>, <a href="/recipes/tags/steinhaus/">steinhaus</a>, <a href="/recipes/tags/trotter/">trotter</a>). Revision 2. </p> <p>The "bell" permutations are those in which only a single inversion of neighbors occurs to generate the next permutation.</p> reshape a sequence (Python) 2012-11-02T04:01:06-07:00Chris Smithhttp://code.activestate.com/recipes/users/2725752/http://code.activestate.com/recipes/578262-reshape-a-sequence/ <p style="color: grey"> Python recipe 578262 by <a href="/recipes/users/2725752/">Chris Smith</a> (<a href="/recipes/tags/group/">group</a>, <a href="/recipes/tags/reshape/">reshape</a>, <a href="/recipes/tags/sequence/">sequence</a>). Revision 4. </p> <p>This function accepts a sequence and a template of how the sequence should be reshaped. </p> lazy DSU (Python) 2012-09-12T04:49:59-07:00Chris Smithhttp://code.activestate.com/recipes/users/2725752/http://code.activestate.com/recipes/578259-lazy-dsu/ <p style="color: grey"> Python recipe 578259 by <a href="/recipes/users/2725752/">Chris Smith</a> (<a href="/recipes/tags/dsu/">dsu</a>, <a href="/recipes/tags/sorting/">sorting</a>). </p> <p>sort a sequence by applying decoration only as needed</p>