On the Collective Sort Problem for Distributed Tuple Spaces