So I have a list of DefaultSearchModal items that have an enum called TypeSearch in every list item. I would like to order the list to have a different enum property each row.
So if you have an unordered list by this:
1,1,2,2,3,3,4,4,5,5,5,5,5,5
I would like to order it to:
1,2,3,4,5,1,2,3,4,5,5,5,5,5
What would be a good algorithm to sort it like this?
public class DefaultSearchModel
{
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public TypeSearch TypeSearch { get; set; }
}
public enum TypeSearch
{
News = 0,
Blog = 1,
Photo = 3,
Page = 4
}