From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9dfc10efb95ba130 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Inefficient algorithms Date: Sun, 12 Sep 2010 23:45:00 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1f6f73cd-f5ff-4408-a1d7-c9ca7dfa70ee@m35g2000prn.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1284349488 26721 192.74.137.71 (13 Sep 2010 03:44:48 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 13 Sep 2010 03:44:48 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:IilOrAuR3byAUETUq0y9SBAiwBY= Xref: g2news1.google.com comp.lang.ada:14031 Date: 2010-09-12T23:45:00-04:00 List-Id: "J-P. Rosen" writes: > Not exactly what you asked for, but a very inefficient array sorting > algorithm: > Generate all possible permutations, and then select the one that is sorted. > It's O(n!) both in time and space... Here's an even slower method: Generate all possible array values, and select the one that is sorted and is a permutation of the input. ;-) - Bob