subject

Create a package named lab10 (no spaces, ALL in lowercase) where you will place your lab files. Create a class SortingAlgorithms with the following methods:
mergeSort that will implement the algorithm learned in class (see slides for code and copy it from there)
selectionSort that will implement the algorithm learned in class (see slides for code and copy it from there ).
two fields:
mergeCtr that will count the merge sort steps
selectionCtr that will count the selection sort steps
these fields must be placed strategically to count every iteration of the sorting algorithms.
two more methods:
getMergeCtr that will return the value of mergeCtr
getSelectionCtr that will return the value of selectionCtr
An app SortingApp that will:
Create an array a with the values 22, 18, 12, -4, 58, sort it using mergeSort, and display the number of steps it took to sort it.
Create another array b with the same values as a 22, 18, 12, -4, 58 and sort it using selectionSort and display the number of steps it took to sort it.
Create another array c with the values 22, 18, 12, -4, 58, 7, 31, 42, -5, 8, 101, 45, 21,-9 sort it using mergeSort, and display the number of steps it took to sort it.
Create another array d with the same values as c 22, 18, 12, -4, 58, 7, 31, 42, -5, 8, 101, 45, 21,-9 and sort it using selectionSort and display the number of steps it took to sort it.
Compare the results among the different calls to the sorting methods, the steps it took to sort, and display a message with your conclusions.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
question
Computers and Technology, 24.06.2019 20:10
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
You know the right answer?
Create a package named lab10 (no spaces, ALL in lowercase) where you will place your lab files. Cr...
Questions
question
Social Studies, 08.07.2019 10:30
question
History, 08.07.2019 10:30
question
Chemistry, 08.07.2019 10:30
Questions on the website: 13722363