Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA 3. Sorting-3 a. Implement 3-way Quicksort for a linked list. Define these methods for the class: i. LinkedList(); constructor ii. add(int a);--Adds a

IN JAVA

image text in transcribed

3. Sorting-3 a. Implement 3-way Quicksort for a linked list. Define these methods for the class: i. LinkedList(); constructor ii. add(int a);--Adds a number to the linked list iii. printList();--Prints the current list contents to console as comma separated values ("1,2,3" iv. quicksort) Runs 3-way quicksort. b. Your requirements for quicksort: i. It must shuffle the linked list. Note: there is no restriction on how you shuffle the list. It is up to you. We will test runtime for different insertions to validate the shuffle. li. It must print out every comparison and what is being compared. ii It should print out every swap. iv. It should print out the current list after finishing a partition (pivot is placed in final location) It should initially use median of 3 selection for the pivot in the first partition. For this problem, include only the class files/code files. No main function file is needed. v. vi. 3. Sorting-3 a. Implement 3-way Quicksort for a linked list. Define these methods for the class: i. LinkedList(); constructor ii. add(int a);--Adds a number to the linked list iii. printList();--Prints the current list contents to console as comma separated values ("1,2,3" iv. quicksort) Runs 3-way quicksort. b. Your requirements for quicksort: i. It must shuffle the linked list. Note: there is no restriction on how you shuffle the list. It is up to you. We will test runtime for different insertions to validate the shuffle. li. It must print out every comparison and what is being compared. ii It should print out every swap. iv. It should print out the current list after finishing a partition (pivot is placed in final location) It should initially use median of 3 selection for the pivot in the first partition. For this problem, include only the class files/code files. No main function file is needed. v. vi

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_2

Step: 3

blur-text-image_3

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions