Explain how to search and sort an array