Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: 27 Jan 2006 02:37:16 -0800
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
.
- Follow-Ups:
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Bill Butler
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Larry Lard
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Wiktor Zychla [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- References:
- interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Wiktor Zychla [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Jon Skeet [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Wiktor Zychla [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Jon Skeet [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Chris S.
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Jon Skeet [C# MVP]
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Bill Butler
- Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- From: Chris S.
- interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- Prev by Date: Re: Declaring a constant
- Next by Date: Re: System.IO.Compression
- Previous by thread: Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- Next by thread: Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- Index(es):
Relevant Pages
|
Loading