You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recreated variations on binary search at least 20 times in the past year. The JDK has two binary search methods, one which searches an array and one which searches a List. These methods only allow searching for the same kind of thing already found in the list. So you can't, for example, search for an item by one of its properties, among other limitations.
However it will be a long time, if ever, before this is introduced into the JDK, and longer before we can use it. On the other hand, this would be very simple to recreate.
Let's consider introducing a module which implements binary search variations. The above method could be used as a starting point, with variations to search by key and other convenience implementations.
The text was updated successfully, but these errors were encountered:
I've recreated variations on binary search at least 20 times in the past year. The JDK has two binary search methods, one which searches an array and one which searches a
List
. These methods only allow searching for the same kind of thing already found in the list. So you can't, for example, search for an item by one of its properties, among other limitations.A better alternative has been proposed here: https://bugs.openjdk.org/browse/JDK-8326330
However it will be a long time, if ever, before this is introduced into the JDK, and longer before we can use it. On the other hand, this would be very simple to recreate.
Let's consider introducing a module which implements binary search variations. The above method could be used as a starting point, with variations to search by key and other convenience implementations.
The text was updated successfully, but these errors were encountered: