Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#custom equality IComparerSingle-choice MCQ

Why does this comparer cause unstable or wrong sort behavior?

class BadComparer : IComparer<int> { public int Compare(int x, int y) => x - y; } // used to sort values including int.MinValue and large positives