It's useless to sort bubbles every time, so I think it's better to change the specification to receive only the sorted array.
else would be all right here at the end, but I'm sorry if I'm wrong.
I think it will be easier to use if you search for the return value and use the array element found.If you can't find it, use
For your information.
© 2022 OneMinuteCode. All rights reserved.