+ 1
Sorting an array in waveform.
How to sort array in waveform ( array[0]>=array[1] <=array[2] >=array[3] ..) in most effecient way? Here is what I did and so I wanna know if this is the most efficient way to do it or not .Ty ! https://code.sololearn.com/c6l3pVydmbOS/?ref=app
2 ответов
+ 3
From what I see, this solution have time complexity of O(n) and uses O(1) auxiliary space which is fairly efficient according to me.
+ 1
Arsenic ty!