this post was submitted on 28 Jan 2024
262 points (95.5% liked)

Programmer Humor

25511 readers
2051 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] murtaza64@programming.dev 10 points 2 years ago (1 children)

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

[โ€“] kuberoot@discuss.tchncs.de 1 points 2 years ago

By that logic, any sorting implementation is O(1), as the indexing variable/address type has limited size