how to sort a vector on the basis of two values code example Example: sort vector sort(v.begin(), v.end());