comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <PChapin@vtc.vsc.edu>
Subject: Re: My Invention of "Bug Sort".
Date: Tue, 19 Jun 2012 07:55:12 -0400
Date: 2012-06-19T07:55:12-04:00	[thread overview]
Message-ID: <P6mdneDa1qsC9X3S4p2dnAA@giganews.com> (raw)
In-Reply-To: <3852c348-a728-44ed-b065-c8a596c1e235@googlegroups.com>

On 2012-06-19 03:13, Austin Obyrne wrote:

> Copyright � 2012 Austin O'Byrne.
>
> Let us say that �NextNum� is a variable in a program output string that the user wants to sort at the end of the program run.
>
> How it works.
>
> Each change in �NextNum� is trapped as it is computed by a �bug� strategically placed in the lines of source code.
>
> Q := NextNum(I);
> I_NUM(Q):= I_NUM(Q)+1;
>
> (This is the bug)
>
> The bug �gets� (captures) the instantaneous value of NextNum as it materializes and then immediately writes this instantaneous value  to a dedicated array in order of *magnitude and returns for the next i.e. each value indexes its own place in the array ( *not in sequential order where the entries would be contiguous and remain unsorted � this is the most salient point for the reader to note).
>
>   *This is defacto sorting per se.
>
> It only needs to read back from the array to see the sorted string which can be anything up to 1 million or more elements sorted in a split second, to complete the task.

I find your style of writing difficult to understand. However, if I 
follow what you are saying, you are talking about Radix Sort. That 
sorting method is O(n) instead of O(n log(n)) (which is the best 
attainable running time for a comparison sort). However in general it 
can have huge memory requirements and is really only practical in 
special cases.

Peter



  reply	other threads:[~2012-06-19 11:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19  7:13 My Invention of "Bug Sort" Austin Obyrne
2012-06-19 11:55 ` Peter C. Chapin [this message]
2012-06-19 13:01   ` Austin Obyrne
2012-06-19 22:39 ` ggsub
2012-06-20  8:32   ` Austin Obyrne
2012-06-20 19:45     ` ggsub
2012-06-20 10:57   ` Austin Obyrne
2012-06-20 12:47     ` Manuel Collado
2012-06-20 12:51       ` Manuel Collado
2012-06-20 13:13         ` Manuel Collado
2012-06-20 15:17         ` Austin Obyrne
2012-06-22 20:31           ` Randy Brukardt
2012-06-20 19:38     ` ggsub
2012-06-20 23:59   ` Austin Obyrne
2012-06-21  1:17     ` Jeffrey R. Carter
2012-06-21  5:13       ` Simon Wright
2012-06-21  7:23         ` Manuel Collado
2012-06-21 11:50           ` Austin Obyrne
2012-06-21 12:09             ` Dmitry A. Kazakov
2012-06-22 20:37               ` Randy Brukardt
2012-06-22 21:16                 ` Simon Wright
2012-06-26 22:29                   ` Randy Brukardt
2012-06-28 19:05                     ` Niklas Holsti
2012-07-03  2:05                       ` Randy Brukardt
2012-06-28 20:59                     ` Simon Wright
2012-07-03  2:11                       ` Randy Brukardt
2012-07-03  9:47                         ` Simon Wright
2012-06-21 18:45             ` Jeffrey Carter
2012-06-22  6:52               ` Austin Obyrne
2012-06-21 15:10         ` Adam Beneschan
2012-06-21 18:24         ` Jeffrey Carter
2012-06-21  7:24       ` Austin Obyrne
2012-06-19 22:56 ` Martin Trenkmann
2012-06-20  0:11 ` robin.vowels
2012-06-20  8:51   ` Austin Obyrne
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox