Some Ad-hocs problems and sort algorithms