Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program with generic merge sort and binary search method help. The programming language I'm using is Java. This program should show understanding generic merge sort
Program with generic merge sort and binary search method help. The programming language I'm using is Java.
This program should show understanding generic merge sort methods and generic binary search methods in java. The execution should include at least 5 found items including one from the first three items in the sorted array and one from the last three items in the sorted array as well as at least two items not found Create a generic merge sort method that will sort any comparable array of elements. Create a generic binary search method that will search any comparable array of elements for a given element. The method should return the location of the target element in the array if found and -1 otherwise. Write a class to represent an item for sale in a for: Brand Name, Description, Size, price and UPC. Include all the usual methods AND the class should implement the Comparable interface where the UPC is used for the grocery store. Each item has information Write a program that reads the contents of the file, creates instances of those items of the class you created, and stores them in an array. There are 5150 items in the file. The program then sorts the array using your merge sort method. After sorting, display the first 3 items in the sorted array and the last 3 items in the sorted array The program then prompt the user for UPCs and searches for them in the array using your binary search method. When the item is found, display all the information about the item. When the item is not found, display an appropriate message Cream of Wheat;Whole Grain Cream of Wheat;18 oz;5.27;7240000025 General Mills:Corn Chex;14 oz;10.94;1600027558 PictSweet All Natural;COB CORN 16 ears:9.69:070560926157 Cass Clay:Calci-Skim Fat Free,Gallon; 1.88:7042217350Step 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