Implemented Selection sort.