Revise the threaded sort application to improve the performance by applying one or more of the principles to improve the efficiency of I/O.Provide a 1-2 page summary of the strategy to improve I/O, an explanation of how you expect the strategy to improve the performance, and a summary of the actual change in performance oberved. Provide what changes were made to the code. Here is the code:import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;public class Sort {  /**   * You are to implement this method. The method should invoke one or   * more threads to read and sort the data from the collection of Files.   * The method should return a sorted list of all of the String data    * contained in the files.   *    * @param files   * @return   * @throws IOException    */  public static void threadedSort(File[] files) throws IOException {  //Commenting out to use the multithread      /* throw new java.lang.IllegalStateException(“Method not implemented”); */  }      /**   * Given an array of files, this method will return a sorted    * list of the String data contained in each of the files.   *    * @param files the files to be read   * @return the sorted data   * @throws IOException thrown if any errors occur reading the file   */  public static String[] sort(File[] files) throws IOException {    String[] sortedData = new String[0];    for (File file : files) {      String[] data = getData(file);      data = MergeSort.mergeSort(data);      sortedData = MergeSort.merge(sortedData, data);    }    return sortedData;  }    /**   * This method will read in the string data from the specified    * file and return the data as an array of String objects.   *    * @param file the file containing the String data   * @return String array containing the String data   * @throws IOException thrown if any errors occur reading the file   */  private static String[] getData(File file) throws IOException {    ArrayList data = new ArrayList();    BufferedReader in = new BufferedReader(new FileReader(file));    // Read the data from the file until the end of file is reached    while (true) {      String line = in.readLine();      if (line == null) {        // the end of file was reached        break;      }      else {        data.add(line);      }    }        //Close the input stream and return the data    in.close();    return data.toArray(new String[0]);  }}




Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.