Skip to main content

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.

0 votes
0 answers
10 views

Evaluating Nested vs. Flat Data Structures for API Data Transmission: Efficiency and Best Practices

I'm exploring best practices for structuring API data responses, particularly the choice between transmitting data as nested and flat data structures. While flat structures tend to simplify backend ...
Skeletor's user avatar
  • 3,371
-3 votes
1 answer
57 views

Create a recursion function for a new output object

I have the following result (response from a external API): Results = [ { "ID": "2", "Name": "Home", "ParentID": "1", &...
Filipe's user avatar
  • 20
-4 votes
0 answers
34 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/...
Edlynn's Mumny's user avatar
-1 votes
0 answers
29 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: ...
PicxyB's user avatar
  • 735
0 votes
0 answers
26 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 ...
taha khamis's user avatar
0 votes
0 answers
11 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 ...
Kaskapa's user avatar
  • 43
2 votes
1 answer
94 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 ...
Twistios_Player's user avatar
1 vote
1 answer
39 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 ...
pbuchheit's user avatar
  • 1,647
-2 votes
2 answers
70 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 ...
bluets's user avatar
  • 1
0 votes
3 answers
67 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 ...
Ahmed Salah's user avatar
-1 votes
2 answers
98 views

Comparing array sums with recursion

I had the following exam question in an intro to a CS course. I could not think of a proper solution for this. Write a function in C that accepts two arrays, arr1 and arr2, and their common size, ...
Eden Bager's user avatar
-3 votes
0 answers
19 views

In MySQL, My recursive view throwing an error when I try to call it [duplicate]

I have the following view: CREATE VIEW finance.accountView AS WITH RECURSIVE hierarchy (id, groupId, type, name, description, parentId, sortOrder, isHidden, idPath, path, sortPath) AS ( ...
ToMakPo's user avatar
  • 858
-3 votes
0 answers
23 views

Issue with Recursive Merge Sort Implementation in Python: Unexpected Sorting Results [closed]

What are the key advantages of using TensorFlow compared to other deep learning libraries? Looking forward to interesting opinions and perspectives Description of actions: I attempted to implement the ...
swwqt's user avatar
  • 1
-7 votes
0 answers
50 views

can a recursive function using a list be adjusted to a set [closed]

Is it true that any recursive function using a list can be adjusted to use a set. Explain your answer in the question above.
DORIS ZOTOKU's user avatar
0 votes
0 answers
27 views

How can I build an object from a file path? [duplicate]

I'm working in JavaScript, and have an array of filepaths: ['root/folder1', 'root/folder1/folderA', 'root/folder1/folderA/folderi', 'root/folder1/folderB', 'root/folder2', ...] and so on. The ...
Sharon's user avatar
  • 3,693

15 30 50 per page
1
2 3 4 5
3151