Question
java code ReadFile Create-a linked list from an input file (input.txt) that contains an even number of first names. The number of items in the
java code
ReadFile Create-a linked list from an input file (input.txt) that contains an even number of first names. The number of items in the file is unknown. Split Create-a split function that divides the newly created linked list into two equal sublists: myList1 and myList2. For example, originally you would point to (John, Jack, Jill, Jim). After the split, myList1 would point to john and jack and myList2 would point to jill and Jim. Traverse Displays the contents of the list Merge Merges then split list into a single lit Hint: You need to define 3 classes for this assignment Class Node{ //Instance variables and methods only. Nothing should be static. //Need getter and setter methods } Class LinkedList{ //Instance variables and methods only. Nothing should be static. //Need getter and setter methods } Class Driver{ Public static void main (String[] args){ } } The call to the split method should look something like this LinkedList myList1=new LinkedList(); LinkedList myList2= myList1.split(); The call to the merge method should look like this myList1.merge(myList2); //myList1 will be the only list
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Answer The code is as follow import javaioBufferedReader import javaioFileReader import javaioIOExce...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