Doubt in Bubble sort

Hello, I want to know that, will bubble sort works in case if
I want to sort the array in decreasing order ? I mean because the idea behind the bubble sort is to take largest element at the last. So should I use it for the reverse case or should I use other sorting algorithms ?

hello @yashsharma4304
u can use bubble sort as well for sorting in decreasing order.
the change that u will need is instead of taking largest to last . take it to the start and repeat the same for remaining element

1 Like

Ok :slightly_smiling_face: