C.T. Matsumoto wrote:
I've change the code and I think I have what you were talking about.
def mysort(list_):
for i in xrange(0, len(list_)):
pos = i
for j in xrange(pos+1, len(list_)):
if list_[i] > list_[j]:
pos = j
list_[i]
Steven D'Aprano wrote:
In future, could you please trim your quoting to be a little less
excessive? There's no need to included the ENTIRE history of the thread
in every post. That was about four pages of quoting to add five short
sentences!
Thank you.
Will do. I usually do just didn't
I've change the code and I think I have what you were talking about.
def mysort(list_):
for i in xrange(0, len(list_)):
pos = i
for j in xrange(pos+1, len(list_)):
if list_[i] > list_[j]:
pos = j
list_[i], lis
On Fri, 12 Mar 2010 11:04:13 pm C.T. Matsumoto wrote:
[snip 269 lines of quoted text]
> Thanks Jeff. Indeed when I kept the code as is and added a doubled
> element to the input list, it went into an infinite loop. For running
> the swap it doesn't matter if the elements are equal. Catching equal
Dave Angel wrote:
C.T. Matsumoto wrote:
Dave Angel wrote:
(You forgot to do a Reply-All, so your message went to just me,
rather than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
Jeff Johnson wrote:
C.T. Matsumoto wrote:
Dave Angel wrote:
(You forgot to do a Reply-All, so your message went to just me,
rather than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
C.T. Matsumoto wrote:
Dave Angel wrote:
(You forgot to do a Reply-All, so your message went to just me,
rather than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
thread it was sugge
C.T. Matsumoto wrote:
Dave Angel wrote:
(You forgot to do a Reply-All, so your message went to just me, rather
than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
thread it was sugge
Dave Angel wrote:
(You forgot to do a Reply-All, so your message went to just me, rather
than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
thread it was suggested I make my own sort
On Thu, 4 Mar 2010 04:34:09 am Glen Zangirolami wrote:
> http://www.sorting-algorithms.com/
>
> It is a fantastic website that explains each kind of sort and how it
> works. They also show you visuals how the sorts work and how fast
> they go based on the amount of data.
For actual practical work,
(You forgot to do a Reply-All, so your message went to just me, rather
than to me and the list )
C.T. Matsumoto wrote:
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the
thread it was suggested I make my own sorting algorithm.
He
Dave Angel wrote:
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the thread
it was suggested I make my own sorting algorithm.
Here are my results.
#!/usr/bin/python
def sort_(list_):
for item1 in list_:
pos1 = list_.index(item1)
pos
http://www.sorting-algorithms.com/
It is a fantastic website that explains each kind of sort and how it works.
They also show you visuals how the sorts work and how fast they go based on
the amount of data.
Depending on the amount/kind of data I would choose a sorting algorithm that
fits your nee
C.T. Matsumoto wrote:
Hello,
This is follow up on a question I had about algorithms. In the thread
it was suggested I make my own sorting algorithm.
Here are my results.
#!/usr/bin/python
def sort_(list_):
for item1 in list_:
pos1 = list_.index(item1)
pos2 = pos1 + 1
Hello,
This is follow up on a question I had about algorithms. In the thread it
was suggested I make my own sorting algorithm.
Here are my results.
#!/usr/bin/python
def sort_(list_):
for item1 in list_:
pos1 = list_.index(item1)
pos2 = pos1 + 1
try:
item2
15 matches
Mail list logo