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 Path: g2news1.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Inefficient algorithms Date: Sat, 11 Sep 2010 08:51:13 +0200 Organization: Adalog Message-ID: References: <1f6f73cd-f5ff-4408-a1d7-c9ca7dfa70ee@m35g2000prn.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 11 Sep 2010 06:51:21 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="zeAFTwWk1JWO9TY/bDbqcg"; logging-data="3345"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ObWiSBJ+MApPHZazlHxny" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: <1f6f73cd-f5ff-4408-a1d7-c9ca7dfa70ee@m35g2000prn.googlegroups.com> Cancel-Lock: sha1:K3hL79PK7HzyepcESyhBsQlV6cY= Xref: g2news1.google.com comp.lang.ada:14006 Date: 2010-09-11T08:51:13+02:00 List-Id: Le 11/09/2010 06:24, Rick a �crit : > I am working on a class in algorithmic efficiency and, to make a > point, need an algorithm that runs O(2^n) - a factoring algorithm > perhaps. All I can find is 'C' code I can't decipher. Can someone > please help with an Ada example. > 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... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr