Does the Java library have functions like std :: lower_bound (), std :: upper_bound () in C ++?

Are there any other alternatives to achieve the same in Java? In C ++, I can use these wonderful methods and make my life easier. Is this also possible in Java? My only goal is to write simple and clean code that is error free.

+4
source share
1 answer

The Java class TreeSet, which is based on a search tree for comparable objects instead of a hash table, has similar methods floorand ceiling. More general methods for any iterative type that you can implement yourself.

+2
source

All Articles