Alex Rivera | Logout

How to make a sortedlist sort reversely? Do I have to customize a IComparer?

Asked 2011-06-01T09:29:24.967
10

In a sortedlist queue, queue.value[0] gives the corresponding value of a min key. what if i would like to make that it gives the value of a max key?

Do i have to rewrite the icomparer?

Edit
Report

1 Answer

1

Here's a link to an article that implements a ReversibleSortedList. This allows for changing the sort direction.

In case you always want reversed sort behavior without the ability to change it on demand, I'd try the constructor that accepts an IComparer.

answered 2011-06-01T09:38:01.963

Your Answer