sorting in vectors on the basis of data code example Example: vector sort c++ sort(v.begin(), v.end());