search algorithms have a term to search and condition to stop, don't they? more like ask them to find what the function is meant to do, but the swap and comparison point to sorting pretty hard.