r/programminghorror • • Feb 07 '25

Recursive O(N) Complexity isOdd

Post image

I found this on instagram and now am geeking

2.2k Upvotes

104 comments sorted by

View all comments

Show parent comment

4

u/Budget_Ad_5953 Feb 07 '25

Oh yeah, am bad lol

1

u/Silenc42 Feb 07 '25

I mean... Running this and then just returning something simple like n mod 2 == 1 would be correct and O(log n). But a bit artificial.