python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Getting the time complexity of a selection sort
I created a code for selection sort, but my teacher asked me what the time complexity of my code is, so I need help to get it. I'm not sure if my code is the same with the other selection sort with a ...
PythonnLearner
Votes: 0
Answers: 2
Difference in Selection Sort Algorithm
Can someone help explain if these two selection sorts have different Big O notations for worst case scenarios or are they the same? Thanks a lot.
""" Selection Sort 1: This function us...

KingNOB
Votes: 0
Answers: 1
I made a function for selection sort, and I can't figure out what's going wrong here
I made a function for selection sort, and I can't figure out what's going wrong here.
void selection_sort(int n,int *arr){
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
...
Shay
Votes: 0
Answers: 4
Why is Selection Sort said to have O(n) swaps?
I am reading about use cases of Selection Sort, and this source says:
(selection sort is used when...) cost of writing to a memory matters like in flash memory (number of writes/swaps is O(n) as comp...
Oleksandr Novik
Votes: 0
Answers: 1