4 ms·
I think someone's ability to understand and explain recursion like am a child is very undervalued. It's not about testing whether you know the base case or the
by deepGem 6y ago
I think someone's ability to understand and explain recursion like am a child is very undervalued. It's not about testing whether you know the base case or the fact that you write less lines of code in recursion but the fact that there is a built-in stack for you to use without creating one.
What are the practical applications of recursion though ? Other than sorting and DFS ( well even DFS can be done iteratively with stacks ). I'll be curious to know.
I find testing for HashTable/HashMap knowledge to be far more practical than testing for LinkedLists simply because you can't escape HashTables in today's world.
- ajuc 6y ago> What are the practical applications of recursion though ? Traversing and transforming nested data structures. Just last month I had to write code that maps flat data from one system into a nested structure required by another system. We wrote mappings as map literals and the code traverses them creating a new instance of the map filling the leaves with data from the input row and running some business logic on it.