Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]



Chris S. wrote:
> my knowledge of quicksort and sorting algorithms isn't accomplished
> enough to work it out. Please reveal all!

Okay, another hint: the problem is in the comparator, and the fact that
quicksort is being used isn't really relevant. Look at what the
contract for IComparer, and think about different possibilities for
what might be passed as the parameters...

(Bill: the algorithm has been tweaked. I don't believe it was tweaked
specifically to get around this flaw, but it's the kind of flaw which
is quite data-sensitive; depending on the data given, 2.0 either
notices the problem or happens to get the result right.)

Jon

.



Relevant Pages

  • Re: sorting algorithms
    ... > I was pondering over the general interest in sorting algorithms. ... > Quicksort seems to have close this chapter ... on several interesting subsets thereof (good average-case performance, ... for medium-sized lists isn't very interesting. ...
    (comp.programming)
  • Re: sorting algorithms
    ... >I was pondering over the general interest in sorting algorithms. ... happened over the past 10 years for quicksort, heapsort, inplace mergesort. ... But this is not general-purpose. ...
    (comp.programming)
  • Re: What is the most fast sorting algorithm?
    ... QuickSort is faster than most sorting algorithms because its loop is ... cache friendly. ...
    (comp.programming)

Loading