3. The purpose of a sorting algorithm is to order/categorize set of items within a series of items.
I. Write a program/method to swap two neighboring numbers in an array when the first index is given.
II. Write a program/method to compare two neighboring numbers in an array when the first index is given.
III. Now combine the above two methods and implement bubble sort algorithm. You must call the above two methods in your sorting program.
IV. Now test your sorting program with a random number array generator you created 2.IV.
Comments
Leave a comment