@[email protected] to Programmer [email protected] • 10 months agoReturns a sorted list in O(1) timeprogramming.devimagemessage-square27fedilinkarrow-up1279arrow-down115
arrow-up1264arrow-down1imageReturns a sorted list in O(1) timeprogramming.dev@[email protected] to Programmer [email protected] • 10 months agomessage-square27fedilink
minus-squareRikudou_SagelinkfedilinkEnglish8•10 months agoIt’s right much more often than just 50/50.
minus-square@[email protected]linkfedilink5•10 months ago50/50 would be for isOdd with the same implementation
minus-square@[email protected]linkfedilink3•10 months agoPrimes 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.