Answered step by step
Verified Expert Solution
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
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. viStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started