JPDev@programming.dev to Programmer Humor@programming.dev · 10 个月前Returns a sorted list in O(1) timeprogramming.devimagemessage-square27fedilinkarrow-up1286
arrow-up1286imageReturns a sorted list in O(1) timeprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 10 个月前message-square27fedilink
minus-squareRikudou_Sage@lemmings.worldlinkfedilinkEnglisharrow-up8·10 个月前It’s right much more often than just 50/50.
minus-squareandnekon@programming.devlinkfedilinkarrow-up5·10 个月前50/50 would be for isOdd with the same implementation
minus-squareLmaydev@programming.devlinkfedilinkarrow-up3·10 个月前Primes are not that common especially as numbers get bigger. It’ll be right the vast majority of times.
50/50 chance of being right in O(1) time
It’s right much more often than just 50/50.
50/50 would be for
isOdd
with the same implementationPrimes are not that common especially as numbers get bigger.
It’ll be right the vast majority of times.