You are viewing a single thread.
View all comments
2 points

you can even have a case where you return the first element of the list if the list is not empty, and it will still be O(1).

permalink
report
reply
1 point

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

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 1

    Monthly active users

  • 256

    Posts

  • 842

    Comments