Computer Science, asked by TheBrain, 1 year ago

Let there be an array of size n, and the selection sort is used to sort it, how many times a swap function is called to complete the execution.

Answers

Answered by SoumyajitPatra24
2

Answer:

N–1 times

Explanation:

Because, every time we swap the ith smallest element with the ith position. And we do this for i=1 to n-1 times.

Answered by hasinikkoduri
0

Because, every time we swap the ith smallest element with the ith position. And we do this for i=1 to n-1 times.

Similar questions