search and sort algorithms source code