Question: Write a java program to read books' information from a text file (book.txt). Each line contains an ISBN 13-digit number followed by book title,
Write a java program to read books' information from a text file (book.txt). Each line contains an ISBN 13-digit number followed by book title, author's name and publication year. These are delimited by commas. Check the sample supplied file on Moodle (unsortedBook.txt) Your program should do the following: a. Read the file contents and add each book's information in an object Book. b. Sort the list of Book objects according to their ISBN numbers. Your algorithm best, worst and average time complexity should be O(n) Where n is the number of books in the file. c. Write the sorted information to a file ("sortedBook.txt"). d. Discuss the data structure that you used in solving this algorithm. In addition, which ADT did you use for the list of books? Justify your choice.
Step by Step Solution
3.36 Rating (152 Votes )
There are 3 Steps involved in it
To tackle this problem lets break it down into steps Step 1 Define the Book Class Create a Book class to hold information about each book such as the ... View full answer
Get step-by-step solutions from verified subject matter experts
