If you run the program I posted you will see that it sorts the file types in ascenting order.
That sort function sorts the strings. If you want to sort on size then you will have to change the sort function. In the sort function use < operator for ascending sort, or > operator for descending sort. You can have as many sort functions as you want to sort the vector on different fields.