recursive tag

18 questions


1 answers
420 views
0
Recursive function problems in javascript

function flatten(oldArr) { var newArr = [] for (var i = 0; i < oldArr.length; i++) { if (Array.isArray(oldArr[i])) { newArr = newArr.concat(flatten(oldArr[i])) } } else { newArr.push(oldArr[i]) } }...


1 answers
402 views
0
I'm trying to implement it like this using Python3 recursive function, but it's blocked, so I'm asking you a question!

It is a format with a netsted structure as shown below.example{ a: { a_a: [ { a_a_a: [ { a_a_a_a: { a_a_a_a_a: { value: first value, check: true } } }, { a_a_a_b: { a_a_a_b_a: { val...


1 answers
97 views
0
Two-minute search-low and high values are implemented recursively by accepting only parameters

int location(int low,int high);int main(void) {int n, num, x, i = 0;//int arr[3];//printf (Please enter in order);//for (i = 0; i < 3; i++) {// // scanf(%d, arr[i]);//}printf (Please enter a number...

1 years ago

3 answers
144 views
0
It's a Java binary output recursive method, but I don't understand.

public static void bin(int num) { if(num>0) { int bin; bin = num % 2; num/=2; bin(num); System.out.print(bin); } } public static void main(String[] args) { bin(10); }This is the code, but...

1 years ago

2 answers
129 views
0
Java recursive call stack overflow error

public static void main(String[] args) { // // TODO Auto-generated method stub int x =2; int n =5; long result = 0; for (int i =0;i<=n;i++){ result += power(x,i); }//end of i System.out.println(re...

1 years ago

1 answers
145 views
0
Python recursive function Fibonacci sequence

n=int (enter the N value of the Fibonacci sequence F(N) --> : ))) def fibo(n): # Recursive functions require escape conditions. if n < 3 : return 1 else : return fibo(n-2) + fibo(n-1)# Find t...

1 years ago

1 answers
111 views
0
cLanguage recursive function time limit axed question

The algorithm you are trying to solve is - The first is 1, the second is 2, and the third is the remaining sequence divided by 100.Write a program that outputs the Nth value using a recursive function...

1 years ago

1 answers
114 views
0
c Multiplication recursive function questions of language digits

Take three natural numbers of three digits, find the product of those numbers, and then write a program as a recursive function that outputs the product of all but zero of each digit of the resulting ...

1 years ago

1 answers
141 views
0
Ask about printing strings using the C language recursive function.

If you output a string of length 3 using two alphabets ab, aaaaababaabbbaababbbabbbYou have to make it come out like this.A two-dimensional character array is dynamically assigned, and the Distr funct...


3 answers
110 views
0
Divided Conquest Conceptual Understanding Question.

In the recursive function problem, many people use an algorithm called segmentation conquest.Stop and sum up by continuing to divide a big problem and get a full answer to a small oneI think it's call...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.