Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Create a class called SortFile. It has a single attribute - - an ArrayList of integers.The class constructor will receive a file anme as

JAVA
Create a class called SortFile. It has a single attribute -- an ArrayList of integers.The class constructor will receive a file anme as its parameter. This file will contain abunch of numbers. The constructor will read the numbers and add them to the ArrayList.The class will also have a method called sort. This method will receive no input and doesnot return anything. It will sort the ArrayList in ASCENDING order. It will use theQuicksort algorithm to do so. DO NOT USE THE PREDEFINED COLLECTIONSSORT METHOD! Theresultant ArrayList should not have duplicate values. You can either ignore duplicatevalues as your sort the list, or remove them after you have sorted it. I do not care whichway you do it, so long as the finished sorted ArrayList does not contain duplicate values.The final method of this class is printList. It also does not receive any input nor returnanything. It will print the contents of the ArrayList, in order, where each value isseparated by a comma. The final number does not have a comma at the end, but a periodinstead.

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

More Books

Students also viewed these Databases questions