โ Back to Interfaces
Question 637
Custom Sort Order With IComparer
Custom Sort Order With IComparer
Write aDescendingComparerclass that implementsIComparer<int>so itsComparemethod orders numbers from largest to smallest. The tester passes it toList<int>.Sortand prints the result joined by commas. Do NOT write aMainmethod. For 3, 1, 2 the program prints: 3,2,1
Expected Output:
3,2,1
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.