Re: O(n^2) complexity of ToCycles in Combinatorica
- To: mathgroup at smc.vnet.net
- Subject: [mg41920] Re: O(n^2) complexity of ToCycles in Combinatorica
- From: wself at msubillings.edu (Will Self)
- Date: Tue, 10 Jun 2003 04:46:52 -0400 (EDT)
- References: <bbt1gd$nf0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Carl K. Woll" <carlw at u.washington.edu> wrote in message news:<bbt1gd$nf0$1 at smc.vnet.net>... [...] > tocycles[p_]:=Block[{f}, > f[i_]:=NestWhileList[p[[f[#]=Sequence[];#]]&,p[[i]],#=!=i&]; > f/@p] Very nice, Carl!