An estimation theoretic basis for the design of sorting and classification networks