Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by haimez on Friday July 22, 2016 @09:16PM
(#12147891)
Not in java (arrays can only be indexed by a signed 32 bit integer) and the C++ solution works exactly the same way with the full 64 bit data types. That much should be obvious, and if you think you might legitimately exceed two billion elements in the array you're sorting- you'd be a fool to rely on someone else's sort implementation.
[ Parent
| on HN ]
Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by Retric on Saturday July 23, 2016 @06:34AM
(#12149068)
Java uses shorts in some JavaCard implementations. So, it's clearly just a legacy limitation which will eventually be removed.
As to C++ 2+ billion byte arrays are not uncommon. It's just a few gigs of ram for int[] arrays.