@JPDev to Programmer Humor • 8 months agoReturns a sorted list in O(1) timeimagemessage-square27arrow-up1294arrow-down114
arrow-up1280arrow-down1imageReturns a sorted list in O(1) time@JPDev to Programmer Humor • 8 months agomessage-square27
minus-square@Lmaydevlink3•8 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.