Question
This is an exercise in correctly implementing insertion sort and selection sort. This assignment includes a text data file containing information on tutorial websites for
This is an exercise in correctly implementing insertion sort and selection sort.
This assignment includes a text data file containing information on tutorial websites for a variety of programming languages. The data file is named Tutorials. It contains records of programming tutorial websites. The record structure for this text file is:
FIELD 1 = Programming Language
FIELD 2 = Name and Description of Website
FIELD 3 = URL Web Address of Language Tutorial
The structure of the file is that there is a separate line for each field/property/attribute of the record. Every three lines makes up one physical record.
For those of you who took computer science I here at CCP, you covered using a bubble sort to sort elements in a collection.
In your project, create two methods for the project one that performs a selection sort on your Tutorial Website object array and one that performs an insertion sort on your Tutorial Website object array.
You should create a user defined object of Tutorial Website type. The object should have three properties:
Language Name
Website Description
Website URL
Your object will need to implement the comparable interface for this object. You may choose the property is used to determine the order of your object. Language name would be the best choice.
Your project should read the list of programming language tutorials in from the text data file, and load the data into a Tutorial Website object . In the process it should copy the object into an array. After the array is fully loaded, sort the list in the array. After the list in the array is sorted, write the list to a different output file. Repeat this process for the other sorting algorithm.
After the program executes, there should be two new output files. One file with the list sorted in ascending order and another file with the list in descending order.
Place the two sorting methods that you create into your project, one that performs a ascending selection sort on your object, and the other method will perform a descending insertion sort on the object array . In your main method of the project call the methods so that it repeats the sorting process for the selection sort and then for the insertion sort. In each method, the file should read the original file, sort the data, and then write the data to a new output file. Both methods should write its output file as CSV File. Your program should have two file writing methods in your project. One that processes and writes the sorted ascending array and one that processes and writes the sorted descending array.
Here is the link to the example data file
Tutorials.txt ( https://drive.google.com/file/d/1QTWDas2wflnTKUhAbSy13Tf8EJQtBtuD/view?usp=sharing )
Include a lab report with your project.
If your application works, you should be able to open the CSV file in Microsoft Excel, then use the features of Excel to work with the data.
After the program is executed, it should create two different text files inside the project folder. one that contains the list in ascending order from the selection sort, and one that contains list in descending order from the insertion sort.
Step 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