Will this algorithm work for a sequence of input 1 2 4 6 77 77 77 8 i.e. one having repeated output it is not creating a dip and will remain constant for some time
Doubt regarding Wave sort algorithm given in video (issue for a case having repeated input values)
Hii Sonali
As mentioned in the video as well that it is assumed that array elements are unique when we apply wave sort algorithm.
But you can obviously sort the array containing simultaneous duplicates suggested by you in wave form by using the sorting approach discussed in the starting of the video which will have time complexity of O(nlogn).
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.