Selection Sort

What is Selection Sort?

Selection sort is a sorting algorithm, which arranges elements present in an array in specific order such as ascending or descending.

Characteristics of Selection sort

  • Time Complexities

    • Worst Case: O(n*n)

    • Average Case: Theta(n*n)

    • Best Case: Omega(n*n)

  • Space Complexities

    • Worst Case: O(1)

  • In place: Yes

  • Stable: No

Java Implementation of Selection sort