comp.lang.ada
 help / color / mirror / Atom feed
From: Austin Obyrne <austin.obyrne@hotmail.com>
Subject: Re: My Invention of "Bug Sort".
Date: Tue, 19 Jun 2012 06:01:03 -0700 (PDT)
Date: 2012-06-19T06:01:03-07:00	[thread overview]
Message-ID: <81bb48ff-9374-47be-9d95-90afbdd1c010@googlegroups.com> (raw)
In-Reply-To: <P6mdneDa1qsC9X3S4p2dnAA@giganews.com>

On Tuesday, June 19, 2012 12:55:12 PM UTC+1, Peter C. Chapin wrote:
> 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

Hi Peter,

I have never heard of Radix Sort unitl you mention it now so I have checked it out on Wikipedia just to get an impression of how it works when compared to my Bug Sort.

That's a truly tortuous algorithm and I can see where the memory goes.

I only deal with whole numbers - integers and alphanumeric characters and the memory consumption is very much smaller - 10 megabytes does an awful lot of sorting i.e in normal situations this is quite little.

My interest is largely in cryptography which never uses anything but integers so you can see why my pre-occupation is with integers. 

There is no comparison as far as I can see between Radix Sort and Bug Sort but I take your point that something taht sorts float values on a basis of signicficant values must require a lot of memory.

If I had that problem I would look for a better solution beforehand.

Many thanks for your useful pointer.

Regards - Austin O'Byrne



  reply	other threads:[~2012-06-19 13:02 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
2012-06-19 13:01   ` Austin Obyrne [this message]
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