Hrmm, I suppose you&#39;re right. I was thinking that we could magically write permute so that it wound up with n! thunks in an array, and then grab the nth element in constant time. I guess that&#39;s not very correct. And by &quot;not very&quot; I mean &quot;not even close to&quot;.&nbsp;<br>
<br><div class="gmail_quote">On Thu, Feb 12, 2009 at 1:33 PM, Brent Yorgey <span dir="ltr">&lt;<a href="mailto:byorgey@seas.upenn.edu">byorgey@seas.upenn.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Well, it sounds nice, but it&#39;s pretty inefficient. &nbsp;And by &quot;pretty<br>
inefficient&quot; I mean &quot;horrendously, terribly inefficient&quot; -- there are<br>
n! permutations of a list of length n, so this would take time O(n!)<br>
as opposed to O(n); O(n!) is even worse than O(2^n).<br>
<br>
-Brent<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>