8
votes
Tar implementation
The recursion here is not tail recursion.
A tail-call is one where no further processing is needed between the called function's return and that of the calling function (this means that the current ...
5
votes
Accepted
Tar implementation
What’s the Deal Here
Tail recursion is an extremely useful pattern. You’d normally use it to transform a loop into an equivalent function that calls itself. All the state that carries over from one ...
4
votes
Accepted
tail recursive directory traversal in Rust
This is Not Tail-Recursive, Because You Recurse from a Closure
The return traverse_directory(...) statement would be tail-...
3
votes
Prevent stack memory usage for recursive function in C
Check the return value of malloc():
malloc() and family returns NULL to signify an error. ...
3
votes
Implementations of unzip in Racket
The apply+foldl approach in WorBlux's answer can be simplified by using the split-at-right ...
3
votes
Accepted
Implementations of unzip in Racket
Doing it with folds pretty much begs you to create a custom accumulator and recursive function or fold within a fold like that.
A couple notes. I don't think foldr...
2
votes
Accepted
F# - Recursively find the first available item in a range definition
preliminaries:
Let us ignore IPv6 and focus on this
proposed scope, supported by a router port:
192.168.0.0/24
interval endpoints
I find this ambiguous;
it needs documentation in the Review Context
...
2
votes
Prevent stack memory usage for recursive function in C
Clean-Up
Use calloc() Where Appropriate
You currently have:
...
2
votes
Prevent stack memory usage for recursive function in C
Some side issues for OP.
Deeper math issues
Best to use float constants rather than double ones to initialize a ...
2
votes
What is better to use for mapping value to Map of functions: tail recursion or foreach?
You never use your Map to lookup a filter function by its key. If you don't need any of the keys then you don't really need a Map...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tail-recursion × 6recursion × 3
c × 2
rust × 1
file-system × 1
memory-management × 1
scala × 1
f# × 1
memory-optimization × 1
scheme × 1
racket × 1
fold × 1