You are provided with some sample code for searching/sorting algorithms, which are currently based on integer arrays.
Question:
You are provided with some sample code for searching/sorting algorithms, which are currently based on integer arrays. However, you are tasked to utilize a custom class that will implement comparable and represents CDs. Each CD has an artist, title, serial number, and price. You decide they should be sorted by serial number.
After careful consideration, you also decide to employ ArrayLists instead of the current integer arrays in make the search routines more generally applicable. Given your previous experience with Generics, you finally decide that you should implement the search and sort algorithms by utilizing comparable generics.
Create your program and create a test case that showcases its functionality for each search/sort.
Accounting Principles
ISBN: 978-0470533475
9th Edition
Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso