why two test cases are failing.is anything wrong in my code?
https://ide.codingblocks.com/s/117347
Array_Bubble_sort
i think t should be arr[i]>arr[i+1]
You Sorting algo is wrong.
Consider test case:
4
3
2
1
0
Your code is giving the output:
1
0
2
3
Code for bubble sort is simple. Refer this code for help;
i checked his code after replacing arr[i]>=arr[i+1] to arr[i]>arr[i+1]…the error u mentioned is eliminated…
Check by submitting the code.
Mark the doubt as resolved if it is solved.
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.