1) Write a program named Algorithms.java that contains the bubbleSort and swap methods from class, except that...
Question:
1) Write a program named Algorithms.java that contains the bubbleSort and swap methods from class, except that you will name these two methods bubbleSortintAscending and swapint, respectively.
2) To Algorithms.java, add the following static methods:
bubbleSortintDescending- sort an array in descending order using the bubble sort algorithm
3) Write a program named AlgorithmsTest that declares and initializes two unsorted arrays. The program will then print the unsorted int arrays (you may need to figure out how to do this so you can see the values), sort the int array using bubbleSortIntAscending, reprint the array, sort it again using bubbleSortintDescending and print it.
4) Additionally test the program by attempting to pass a null value to either of the bubble sort algorithms. Comment out the code that does this before vou turn in the test program. The program SHOULD NOT crash because of this. Instead, print out an explanation of what happened IN the program so that it appears as part of the program output.
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch