algorithm de tri (implementation)