Sorting routine implementations in "template" C