c++ - Sort two QVector -
i have got 2 qvector<double>s x , y. vectors represent info points a(x[0], y[0]), b(x[1],y[1]), , on. want sort x , modify y info points still a(x[n], y[n]). illustration if have x{3,6,1,5} , y{9,2,1,5} should receive: x{1,3,5,6} , y{1,9,5,2}. there algorithm that?
you temporarily merge vectors (for illustration using std::pair), sorting (with std::sort) , split pairs 2 vectors again.
c++ algorithm qt
No comments:
Post a Comment