New answers tagged recursion
0
votes
C++17 Recursive Fibonacci calculation with memoization
I know question is 2 years old, but my two cents for gcc ver > 6.1, if it helps
...
- 1
3
votes
Accepted
Ackermann-Péter function call count using Writer monad
The first thing that jumps out is these lines:
let (secondArg, count) = runWriter $ ackCount m (n-1)
tell (Sum $ getSum count)
You're not ...
- 3,591
1
vote
Accepted
The usages of make_view Template Function in C++
This isn’t really very useful. What you want to do, in just about every case I can imagine, is create the transformed data structure. It meets the requirements of ...
- 3,341
1
vote
A recursive_transform_view Template Function which returns a view in C++
This is not useful
Davislor mentioned correctly that:
Returning a non-owning view of a temporary object will result in a dangling reference!
So what you really want to do is create the transformed ...
- 42.4k
1
vote
Accepted
A recursive_transform_view Template Function which returns a view in C++
Do I Contradict Myself?
Very well, then I contradict myself. Since you asked specifically about the use of std::ranges::subrange versus ...
- 3,341
1
vote
A recursive_transform_view Template Function Implementation
Please Post a More Minimal Example
There’s a lot here that was copied from other answers, or implements a completely different algorithm than the one you’re asking for feedback on. At least split up ...
- 3,341
1
vote
Accepted
A recursive_transform_view Template Function Implementation
The name is wrong
Calling this recursive_transform_view() gives the impression that this return a std::ranges::view. However, ...
- 42.4k
1
vote
A recursive_transform Template Function with Unwrap Level for std::array Implementation in C++
The Inserter Fails on Most STL Structures
In particular, std::inserter assumes that the container has a push_back member ...
- 3,341
1
vote
A Function Applier for Applying Various Algorithms on Nested Container Things in C++
What does it do?
I am trying to generalize the operation of applying a function on elements in nested container.
If you say that, I would think that your ...
- 42.4k
2
votes
Accepted
A recursive_transform Template Function with Unwrap Level for std::array Implementation in C++
It's just getting better and better!
Use a constraint instead of static_assert()
You can trivially turn the static_assert() you ...
- 42.4k
1
vote
Get value from dictionary given a list of nested keys
Here is a compact and versatile way to accomplish this without extra libraries:
...
- 119
Top 50 recent answers are included
Related Tags
recursion × 1103python × 243
java × 218
algorithm × 174
c++ × 158
performance × 154
javascript × 109
c# × 100
programming-challenge × 77
tree × 69
beginner × 66
python-3.x × 64
c × 56
combinatorics × 50
c++20 × 49
strings × 48
functional-programming × 47
array × 42
dynamic-programming × 34
haskell × 33
sorting × 28
file-system × 28
interview-questions × 24
php × 23
iteration × 23