Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Binary Search
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Andreas Leitgeb, post: 4197744"] For smaller number of items not all that surprising. For larger numbers: Roedy also mentioned Hash-/TreeMaps. Roedy, would you tell us at which sizes the maps started to be better than linear search in your test? Also, whether your searches were always for exact matches, or if you also had searches for "smallest greater/eq than" or the like. Sounds likely. I think it was even mentioned already - especially the slightly more predictable branchings of linear searches (thus pre-caching of the code-path that's more likely to follow). Locality of access likely plays a smaller role in Java, unless we speak exclusively of arrays of primitives. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Binary Search
Top