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.
recursion
47,259
questions
0
votes
1
answer
39
views
Get all hierarchy in SQL Server
I have a table like this:
ID_employee
ID_Manager
1
1
2
1
3
1
4
2
5
3
6
5
7
5
8
5
(1 is a boss)
What I would like is a result like:
ID_employee
ID_Manager
8
5
8
3
8
1
7
5
7
3
7
1
6
5
...
-2
votes
0
answers
12
views
Setting Up a DNS Server to Prevent Recursive Lookups [closed]
I'm trying to set up my own DNS server for my domain to return different IP addresses based on the client's ISP. However, I'm encountering an issue because the DNS lookups from users are often proxied ...
0
votes
0
answers
15
views
Accessing the previous rows of the same calculating column in dax
I am creating a new calculated column called Final_Value in my calculated table called INDEX_1.
The condition is I have three columns called Kombi,JJJJ_MM, Value. Each kombi consists one row entry for ...
0
votes
1
answer
46
views
How to self reference a calculated column in SQL (BigQuery)
I have a table like shown below:
row_number
usd
cad
1
10
13
2
15
18
3
-5
null
4
2
8
5
-11
null
I'm trying to write a SQL query in BigQuery to create a new_cad column that has the following ...
2
votes
1
answer
81
views
codatatypes and least predicates in Dafny. Does it make any sense?
I am trying to deal with infinite lists as follows:
codatatype iList = iCons(head: int, tail: iList)
least predicate isIn(e: int, l: iList)
{
e == l.head || isIn(e, l.tail)
}
least predicate ...
0
votes
3
answers
72
views
Why is my recursive function not returning all of the data?
I have a python function to return all the files in some directory (and its sub-directories) as a numpy array, it goes over all of the files (as shown by the print statement), but only returns the ...
-3
votes
1
answer
78
views
Create a recursion function to respond with a different object [closed]
I'm a receiving the following data from a HTTP request to get all menus available:
[
{
"ID": "2",
"Name": "Home",
"ParentID": "1&...
-4
votes
0
answers
37
views
Calculate support base on previous record [closed]
I have a task to join a few tables in SQL Server and here is my final result.
ITEM
Montht
Fcst
SOH
Pastdue
SIT
TLB
EW71046000
7/1/2024
308
151
0
0
0
EW71046000
8/1/2024
136
0
0
72
0
EW71046000
9/1/...
-1
votes
0
answers
30
views
Recursive function in graph theory
I recently read an article about NASA code quality rules and one of these rules is to avoid recursive functions (that are complex to understand and to debug)
When I am working on a graph like:
...
0
votes
0
answers
32
views
How to Optimize Recursive Multi-step Forecasting to Improve Performance? [closed]
I am working on a machine learning project for hourly sales forecasting. I need to make 7-day ahead sales predictions. My model (XGBoost) uses lag sales from 24 hours ago as one of the inputs, to be ...
0
votes
0
answers
12
views
Heuristics and IDA* for an F2L solver not working and I don't know why
I have generated a simple heuristics database for an F2L solver for a Rubik's cube. I represent the state in a way that I need 2 heuristic databases. One is for the pair corner and the other is for ...
2
votes
1
answer
95
views
Why is the 'limit' limit of maximum recursion depth in python 2**32 / 2 - 31?
In Python, some programs create the error RecursionError: maximum recursion depth exceeded in comparison or similar.
This is because there is a limit set for how deep the recursion can be nested.
To ...
1
vote
1
answer
42
views
Extracting a Zip archive containing nested zip files using Kotlin
I'm working on an application that needs to extract a zip archive of json documents into a folder. The problem I'm encountering is that sometimes the archive contains nested zip files. My current code ...
-2
votes
2
answers
73
views
Leetcode 417: Pacific Atlantic Waterflow [closed]
There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's ...
0
votes
3
answers
71
views
difficulty to understand the code, and maybe the concept itself (recursion problem)
this code below is from Grokking Algorithms book that is an exercise for the functional programming/recursion and an application for the D&C concept. the function finds the maximum number in a ...