0
Bubble sort algorithm
I need help adjusting my bubble sort algorithm: It's not sorting the array, and at the end returns a random string of numbers. what am I doing wrong? https://code.sololearn.com/cieUOC4nHvLX/?ref=app
1 ответ
+ 7
Use i<size instead of i<=size :)
Since the array size is 4, the valid indices are 0, 1, 2, 3. We can't include 4 as the index.
https://code.sololearn.com/cmk9nW6aXATA/?ref=app