Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need in Java please. Section 1: Add your section comment to the code. Print ********** Section 1 Quick Sort ********** Print a blank line. Create

Need in Java please.

Section 1:

Add your section comment to the code.

Print ********** Section 1 Quick Sort **********

Print a blank line.

Create an array of integers as shown in the example code.

Create a method called sortAsc() which will perform a quick sort on the array to sort the data into ascending order.

On a new line, print The array unsorted is, followed by printing the original unsorted arrays contents.

Call the method sortAsc() passing it the necessary data to sort the array into ascending order.

Print a blank line.

On a new line, print The array sorted is, followed by printing the sorted arrays contents.

Section 2:

Add your section comment to the code.

Print a blank line.

Print ********** Section 2 Bubble Sort **********

Print a blank line.

Create an array of integers as shown in the example code.

Create a method called bubbleSort() which will perform a bubble sort on the array to sort the data into ascending order.

On a new line, print The array unsorted is, followed by printing the original unsorted arrays contents.

Call the method bubbleSort() passing it the necessary data to sort the array into ascending order.

Print a blank line.

On a new line, print The array sorted is, followed by printing the sorted arrays contents.

Section 3:

Add your section comment to the code.

Print a blank line.

Print ********** Section 3 Binary Search **********

Print a blank line.

Create a method called binarySearch() which will accept a presorted integer array and a value to find in the array. The method should return a string stating at which index the value was found in the array or a message that the value is not located in the array.

Call the binarySearch() method, passing it the sorted array from Section 1 and the integer 8801 as the search value.

Print a blank line.

On a new line, print the message returned by the binarySearch() method.

Call the binarySearch() method a second time, passing it the sorted array from Section 1 and the integer 7777 as the search value.

Print a blank line.

On a new line, print the message returned by the binarySearch() method.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions