Searching and Sorting Algorithms (Java)