+2 votes
in Class 12 by kratos

Write an algorithm for selection sort.

1 Answer

+4 votes
by kratos
 
Best answer

Selection sort performs the following steps:

  1. Starting at index 0, search the entire array to find the next smallest or largest value.

  2. Swap the smallest or largest value found with the value at index 0.

  3. Repeat steps 1 & 2 starting from the next index.

...