Write a bubble sort code which should work for any array size up to the memory limit. The program should print the output using a different function, and also must print the number of swaps which took place. Run the code for input sizes, 500, 50000 and 500000 -- for best, approximately average and worst cases.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
why rand() should be used in average and worst cases? If without rand() we implement it ,what will be disadvantage