arrays and ordered collection in c++