Implemented recursive selection sort