[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lhs and rhs in table.sort
- From: Parke <parke.nexus@...>
- Date: Thu, 27 Aug 2015 09:32:22 -0700
On Thu, Aug 27, 2015 at 8:55 AM, Coda Highland <chighland@gmail.com> wrote:
> Bubble sort, on the other hand, is especially vulnerable to bad
> comparators, because it tries to sort the entire array on every pass.
Bubble sort can be trivially improved to walk over one less element on
each successive pass, guaranteeing termination (unless the compare
function itself never returns).
https://en.wikipedia.org/wiki/Bubblesort#Optimizing_bubble_sort
-Parke