3 ms·
Yeah, the funny thing about all the data structures & algorithms quizzes is that the simplest solution is usually a recursive one, and the big-O performance is
by kyllo 13y ago
Yeah, the funny thing about all the data structures & algorithms quizzes is that the simplest solution is usually a recursive one, and the big-O performance is sort of irrelevant because chances are you're using a language that doesn't have tail-call optimization and you're going to blow the stack frame for any large value of n anyway.
- gizmo686 13y agoMany recursive algorithms only require log(n) entries in the stack. Even if you do start overflowing the stack, it is simple to take a recursive implementation and turn it into an 'iterative' one, where you just manage the stack yourself.