Why are there non generic versions of binary search in Java? -
why there non generic versions of binary search in java?
is because don't want crash existing implementations?
there of course generic version of binarysearch
1.
the reason why there non-generic overloads performance: value types need boxed (and copied) in order able use generic binarysearch
. same goes sort
, other algorithms.
1 in fact there’s more 1 generic overload that’s not relevant here.
Comments
Post a Comment