[Solved] Simple Bubble sort program. It works flawlessly about 85% of times but in some cases it doesn’t sort the list
[ad_1] You are not using bubble sort. this is a selection sort algorithm and your code is not correct. I have updated the code for the bubble sort algorithm. #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int ctr, inner, outer, didSwap, temp; int nums[10]; time_t t; srand(time(&t)); for (ctr = 0; ctr < … Read more