Questions tagged [recursive]
The recursive tag has no usage guidance.
6
questions
0
votes
0answers
46 views
help with pset3 tideman lock_pairs function
This function is a recursive function, that lock_pairs is using to understand if a pair will create a cycle:
bool create_cycle(int win_idx, int orig_idx)
{
if (win_idx == orig_idx) // if it's not ...
0
votes
1answer
40 views
Iterative vs Recursive
I have searched in many resources on web and most of them claim, that iterative way of problem solving is faster. Plus, as I understood, recursive should require more memory during processing.
My ...
0
votes
1answer
455 views
pset5: working, no leaks but many errors says valgrind in my recursive trie
well it works, but i keep getting many errors related to init and freeRecursive that are my recursive functions to generate and delete my trie
most of my errors are related to the condition of ...
0
votes
1answer
99 views
Pset 3 Recursive Binary Search problems - Always returns true
I have tried almost everything and edited my code a hundred times in search of an answer. It seems that whenever I run the program (find.c) the result always resolves to true. Not sure where the ...
0
votes
1answer
27 views
using return in call to recursive function
I've got a question. I'm using the unload function from my pset5 speller code as an example. I read somewhere that it is good habit to include a return in front of your call to the recursive function. ...
0
votes
1answer
21 views
calculations vs variables performance
In recursive scenarios, what brings more performance? Doing 3-4 simple calculations once, store result on a variable and then use variable maximum 3-4 times in each recursive function call? Or to skip ...