# LaVOZs

The World’s Largest Online Community for Developers

'; Newest 'recursion' Questions - LavOzs.Com

# Questions tagged [recursion]

Recursion is a kind of function call in which a function calls itself. Such functions are also called recursive functions. Structural recursion is a method of problem solving where the solution to a problem depends on solutions to smaller instances of the same problem.

I am trying to find the nth derivative of a function using the grad function from the autograd library. grad(x) gives the 1st order derivative, but it doesn't allow a variable to find let's say the ...
• ### Big O estimate with loop and recursion

void call(int n) { for (int j=1;j<=n;j++) { call(n/2); } } void main() { int i; for (i=1;i<=n;i++) { ...
• ### python maximum recursion depth exceeded

i want to make a program that return caller&callee for any java project. i have this method: def searchformethod(methodcalls,method): for call in methodcalls: if method in call: ...
• ### Time complexity while loop with recursion

void call(int n) { for (int j=1;j<=n;j++) { call(n/2); } } void main() { int i; for (i=1;i<=n;i++) { call(i); ...
• ### Finding all clusters of coordinates where each coordinate in a cluster is separated from one another by less than some maximum distance

I have this set of coordinates: [[211,76], [235,84], [240,88], [300,79], [230,100], [203,110], [202,95], [203,98], [214,97], [248,137], [249,111], [282,120], [263,144], [245,167], [192,172], [124,161]...
• ### Expected expression before ',' token reverseString(++s*, --sSize);

I wrote my function to print a string in reverse order, but it keeps showing an error: expected expression before ',' token reverseString(++s*, --sSize); Code snippet: void reverseString(char* s,...
• ### Summing elements inside tuple of tuples with recursion

So my problem is as follows: I have a tuple with 1 or more tuples inside it and i want sum all the numbers inside the tuple. But something is missing because theres a case when u have a tuple with a ...
• ### How to implement a recursive function that prints out how many common elements there are in two lists?

Im doing an assignment in school where i'm supposed to find how many common elements there are in two lists and I don't know where to start.
• ### Any other shorter way to solve this problem through recursion

Suppose you have a string made up of only 'a' and 'b'. Write a recursive function that checks if the string was generated using the following rules: 1. The string begins with an 'a' 2. Each 'a' is ...
• ### Why does Scala fail to compile this function as tail recursive?

If I replace the first line of the following recursive depth first search function with the lines commented out within the foreach block, it will fail to compile as a tail recursive function (due to ...
• ### Explain the working of this pascal's algorithm

1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 def pascal(n): if n == 1: ...
• ### how to compute the determinant of a Matrix in C using recursive functions

Hello I was trying to make a C program that calculate the determinant of a given matrix. I somewhat completed it but I got stuck when I was trying to make a function that finds the sub matrix of a ...
• ### Why is methodExit is also executing multiple times - please explain the flow of this code

After running this code method1 is executing 11 times which is understood but why methodExit is running 10 times as according to me method1 should run 10 time but after return it should go to ...
• ### How to define a recursive for loop in R?

I have a priorly unknown number of variables, and for each variable I need to define a for loop and perform a series of operations. For each subsequent variable, I need to define a nested loop inside ...