package
0.0.0-20240615115840-a222ecda5fb5
Repository: https://github.com/koykov/algoexpert.io.git
Documentation: pkg.go.dev
# README
Selection Sort
Category: Sorting
Difficulty: Easy
Description
Write a function that takes in an array of integers and returns a sorted version of that array. Use the Selection Sort algorithm to sort the array.
If you're unfamiliar with Selection Sort, we recommend watching the Conceptual Overview section of this question's video explanation before starting to code.
Sample Input
array = [8, 5, 2, 9, 5, 6, 3]
Sample Output
[2, 3, 5, 5, 6, 8, 9]
Optimal Space & Time Complexity
Best: O(n^2) time | O(1) space - where n is the length of the input array\nAverage: O(n^2) time | O(1) space - where n is the length of the input array\nWorst: O(n^2) time | O(1) space - where n is the length of the input array