dimanche 15 mars 2015

How to sort 2d array by first, then second, then third, ... columns using C++?


I have an array in C++ that looks like



95 52
95 20
95 67
76 25
76 250


and I want to sort it by the first column, and then by the second. In general, I may have $n$ columns so I may need a recursive function. Anyone have any fast and efficient ways of doing this? The end goal is to get a list of the unique rows.




Aucun commentaire:

Enregistrer un commentaire