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
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
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