You can't simply add a new item and assume it will be put in sorted order into your arraylist. There are two options:
1. Re-sort your arraylist.
2. Manually look for where the book needs to be...
Type: Posts; User: helloworld922
You can't simply add a new item and assume it will be put in sorted order into your arraylist. There are two options:
1. Re-sort your arraylist.
2. Manually look for where the book needs to be...
Don't create your own collection class, there's already one which exists.
Simply create your list of comparable objects and pass them to your algorithm.
Here's a simple example:
// Book...