Relative Content

Tag Archive for recursion

Can a recursive function have iterations/loops?

I’ve been studying about recursive functions, and apparently, they’re functions that call themselves, and don’t use iterations/loops (otherwise it wouldn’t be a recursive function).

Performance: recursion vs. iteration in Javascript

I have read recently some articles (e.g. http://dailyjs.com/2012/09/14/functional-programming/) about the functional aspects of Javascript and the relationship between Scheme and Javascript (the latter was influenced by the first, which is a functional language, while the O-O aspects are inherited from Self which is a prototyping-based language).

Recursion or while loops

I was reading about some development interview practices, specifically about the technical questions and tests asked at interviews and I’ve stumbled quite a few times over sayings of the genre “Ok you solved the problem with a while loop, now can you do it with recursion”, or “everyone can solve this with a 100 lines while loop, but can they do it in a 5 lines recursive function?” etc.

Is this an example of recursion?

I am implementing inheritance of something called Contexts. Each Context holds a link to its parent context. If that Context is the root Context, its parent is null.