Skip to main content
2 votes
1 answer
61 views

I'm building a FastAPI application and modeling a forum-style comment system using Pydantic v2. Each comment can contain replies, and those replies can contain more replies, recursively, similar to ...
Mauricio Reisdoefer's user avatar
-1 votes
0 answers
63 views

I just started playing around with Common Lisp and tried the first euler problem which states to sum all the divisors of 3 OR 5 under some given parameter x. I would like to use a recursive solution ...
Patrick Donegan's user avatar
4 votes
3 answers
155 views

I keep almost solving this. I've got a data set of python dictionaries that contain both lists and dictionaries that also contain lists and dictionaries. I want to find all instances of a substring in ...
pileofrogs's user avatar
3 votes
2 answers
162 views

I do understand I have mistakes in this code #include <stdio.h> #include <stdlib.h> #include <string.h> int diziyi_yazdır(int dizi[], int dizi_uzunluğu) { for (int i ...
Creedance's user avatar
-2 votes
1 answer
181 views

I’m trying to implement an in-place Quick Sort in Python. I have two slightly different versions of my partitioning logic, and I’m confused because both seem correct on small arrays, but the second ...
Lisguen's user avatar
  • 11
3 votes
1 answer
125 views

At the risk of asking a question with an obvious solution: if I have a function in J that takes two arguments and returns two arguments and I want to accumulate the answer's second argument and to use ...
Shmuel Greenberger's user avatar
3 votes
3 answers
87 views

I am working on LeetCode problem 22. Generate Parentheses using a recursive backtracking approach in Python. The function works, but I’m having trouble understanding the flow of recursion, ...
Caleb's user avatar
  • 31
1 vote
2 answers
161 views

My question is focused specifically on assembly (intel). In C for example, recursion can be done with a simple return command but in assembly I feel like there's a lot more things going on, especially ...
Danilo Jonić's user avatar
0 votes
1 answer
87 views

this is kind of a continuation of an improved version of an old question of mine so basically I have a recursive Angular form and I’m using to manage a folder hierarchy. Each folder has a radio button ...
binga58's user avatar
  • 89
1 vote
2 answers
153 views

Let's say our binary tree (bt) looks like this: Node* root = new Node(); root->left = new Node("B"); root->right = new Node(); root->right->right = new Node("A");...
Arun Saini's user avatar
-1 votes
2 answers
167 views

# Iterative factorial function to safely compute very large factorials without hitting Python's recursion limit. # Recursive functions have a maximum depth, usually 1000, and factorial(2000) would ...
user31537598's user avatar
2 votes
1 answer
116 views

I have a recursively defined function my_func that is jitted using jax.jit from the jax library. It is defined below: # Imports import jax import jax.numpy as jnp from functools import partial import ...
Ben's user avatar
  • 539
0 votes
1 answer
67 views

When using this algorithm: jq -s 'def deepmerge(a;b): reduce b[] as $item (a; reduce ($item | keys_unsorted[]) as $key (.; $item[$key] as $val | ($val | ...
staxas's user avatar
  • 149
0 votes
1 answer
41 views

I'm trying to render a tree structure using VLT, by indenting the rendering depending on the level it's on. I tried to use a recursive macro which passes on the $indentLevel variable (see code below). ...
Sebastiaan Voorderhake's user avatar
1 vote
2 answers
92 views

I am trying to convert an XML string into multi-dimensioned PHP array. The difficulties are that XML comes with attributes and has nested values. My code works at parent level data but I am not sure ...
user5705009's user avatar

15 30 50 per page
1
2 3 4 5
3163