Selection Sort Algorithm
Is a linear sort algorithm which focus on moving through an array and put in each position the smaller corresponding element in the same array. The Selection Sort Algorithm run the array's elements from its first to the last and for earch position look in their next elements a smaller value than the current and if is found then make a switch of values in the two the position. It has O n2 time complexity which make it inefficient on large lists. Generally performs better than bubble and worse than the insertion sort. For Example: Having the following list: 3,5,1,2 where bold element means the current position. 1st Iteration: [3, 5, 1, 2] The algorithm look for the smallest element in the array after the current index which in this iteration is 3 , the result will be 1 . So the array will end like this: [ 1 , 5, 3, 2] 2nd Iteration: [ 1 , 5 , 3, 2] The algorithm look for the smallest element in the array after the current index which in this itera...