@JPDev@programming.dev to Programmer Humor@programming.dev • 10 months agoReturns a sorted list in O(1) timeprogramming.devimagemessage-square25fedilinkarrow-up1251arrow-down112
arrow-up1239arrow-down1imageReturns a sorted list in O(1) timeprogramming.dev@JPDev@programming.dev to Programmer Humor@programming.dev • 10 months agomessage-square25fedilink
minus-square@murtaza64@programming.devlinkfedilink11•10 months agoyou can make it sort the first k elements and it will still be O(1). Set k high enough and it might even be useful
minus-square@xmunk@sh.itjust.workslinkfedilink5•10 months agoI set k to 50,000,000,000… that’s more items than my shitty computer can fit in memory (including swsp) but I am now happy to celebrate my O(1) algorithm.
you can make it sort the first k elements and it will still be O(1). Set k high enough and it might even be useful
I set k to 50,000,000,000… that’s more items than my shitty computer can fit in memory (including swsp) but I am now happy to celebrate my O(1) algorithm.