I am trying to implement sorting in list using IComparer Interface.
If any two values are equal, then there order is not maintained in the list
after using sort function.
Say, I am sorting an Employee object based on Department ID like,
Employee 1 -> Dept ID = 100, Name = "John"
Employee 2 -> Dept ID = 100, Name = "Peter"
Employee 3 -> Dept ID = 100, Name = "Wills"
The output of this after sorting based on Department ID should be
but the output is
where the order is getting changed if the values in the sort column are equal.
Is it possible to maintain the order if the elements are equal.
View Complete Post