On Tue, Feb 14, 2012 at 11:10 AM, Jabba Laci wrote:
> Hi,
>
>> Either you're misremembering, or the algorithm you programmed 43 years
>> ago was not actually bubble sort. Quoting from Wikipedia:
>>
>> """
>> Bubble sort, also known as sinking sort, is a simple sorting algorithm
>> that works by r
Wilson, Mel wrote:
>Well, the classic bubble sort swaps adjacent elements until the extreme one
>gets all the way to the end. This sort continually swaps with the end
>element during one pass until the end element holds the extreme. Then it
>shrinks the range and swaps then next less extreme i
Prasad, Ramit wrote:
> My apologies, you are correct. It is a selection sort, just an inefficient
> one.
Hmm, I think I should say it is neither since it reminds me of a hybrid of
both (bubble/selection).
The swapping seems very bubble sort, but the looking for the min / max
case seems selectio
Hi,
> Either you're misremembering, or the algorithm you programmed 43 years
> ago was not actually bubble sort. Quoting from Wikipedia:
>
> """
> Bubble sort, also known as sinking sort, is a simple sorting algorithm
> that works by repeatedly stepping through the list to be sorted,
> comparing
On Tue, Feb 14, 2012 at 9:55 AM, Den wrote:
> On Feb 14, 8:22 am, Arnaud Delobelle wrote:
>> On 14 February 2012 15:31, Dennis Lee Bieber wrote:
>>
>> > On Tue, 14 Feb 2012 16:01:05 +0100, Jabba Laci
>> > wrote:
>>
>> >>Could someone please tell me what the following sorting algorithm is
>> >>
Den wrote:
> I disagree. In a bubble sort, one pointer points to the top element,
> while another descents through all the other elements, swapping the
> elements at the pointers when necessary.
'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it
means just what I choose it
On Feb 14, 8:22 am, Arnaud Delobelle wrote:
> On 14 February 2012 15:31, Dennis Lee Bieber wrote:
>
> > On Tue, 14 Feb 2012 16:01:05 +0100, Jabba Laci
> > wrote:
>
> >>Could someone please tell me what the following sorting algorithm is called?
>
> >>Let an array contain the elements a_1, a_2, .
Prasad, Ramit wrote:
>>
> for i in xrange (N-1):
> for j in xrange (i, N):
> if a[j] < a[i]:
> a[i], a[j] = a[j], a[i]
>> It's what Wikipedia says a selection sort is: put the least element in
>> [0], the least of the remaining elements in [1], etc.
>
> If your only requi
On 14 February 2012 15:31, Dennis Lee Bieber wrote:
> On Tue, 14 Feb 2012 16:01:05 +0100, Jabba Laci
> wrote:
>
>>Could someone please tell me what the following sorting algorithm is called?
>>
>>Let an array contain the elements a_1, a_2, ..., a_N. Then:
>>
>>for i = 1 to N-1:
>> for j = i+1
Am 14.02.2012 16:01, schrieb Jabba Laci:
Could someone please tell me what the following sorting algorithm is called?
Let an array contain the elements a_1, a_2, ..., a_N. Then:
for i = 1 to N-1:
for j = i+1 to N:
if a_j< a_i then swap(a_j, a_i)
It's so simple that it's not ment
>
for i in xrange (N-1):
for j in xrange (i, N):
if a[j] < a[i]:
a[i], a[j] = a[j], a[i]
> It's what Wikipedia says a selection sort is: put the least element in [0],
> the least of the remaining elements in [1], etc.
If your only requirement to match to selection sort is
Jabba Laci wrote:
> Could someone please tell me what the following sorting algorithm is
> called?
>
> Let an array contain the elements a_1, a_2, ..., a_N. Then:
>
for i in xrange (N-1):
for j in xrange (i, N):
if a[j] < a[i]:
a[i], a[j] = a[j], a[i]
>
> It's so simple t
12 matches
Mail list logo