Hello i Have a "vector of vectors" that looks something like this
3 1 2 0 77
0 3 1 2 44
1 0 3 2 29
3 0 1 2 49
I would like to sort them according to the last element in every row so that it would look like this in the end
1 0 3 2 29
0 3 1 2 44
3 0 1 2 49
3 1 2 0 77
Of course my real example is a lot more complex... but this is basically what I need to get done. Right now I use this snippet which seems to sort according to the first elements.
vector<vector<int>>population;
partial_sort( population.begin(),population.begin()+10, population.end() );
Thanks for any help /Buxley