Skip to main content
1 vote
2 answers
71 views

I am trying to understand how recursion and backtracking work in the following Java method that prints all subsets of a string. I understand the base case where idx == s.length() and the current value ...
Rajkumar Patil's user avatar
Advice
2 votes
3 replies
47 views

0-1 Knapsack problem is often used as a starting problem to understand dynamic programming. This problem can also be solved using backtracking. Now, backtracking explores all possible subsets and uses ...
Hades's user avatar
  • 11
2 votes
1 answer
53 views

Below code is from nmap tableaux.lua script file which is located at /usr/share/nmap/nselib local tcopy_local function tcopy(t) local tc = {} for k, v in pairs(t) do if type(v) == "table&...
Yilmaz's user avatar
  • 51.2k
-2 votes
1 answer
70 views

I’ve found a way to remove the annoying thumbs file that prevents me from deleting folders. Currently, I go into a folder, shift-click “run power shell window here and then type: rm thumbs.db -force ...
mrshmuga9's user avatar
9 votes
1 answer
313 views

I have table of structure data in SQL Server. I want to travese the tree and find all nodes with a recursive query. Additionally, the structure data is versioned. I want to always use the latest ...
Truncated's user avatar
  • 103
0 votes
0 answers
60 views

I'm struggling with some code I can't get my head around. It was handed off to me from a developer running MySQL v.8 and I'm working on a client's server running MySQL 5.5. The code I'm working with ...
Allison Wonderland's user avatar
1 vote
2 answers
184 views

I was reading some stackoverflow question that I thought would be solvable with recursion. So I tried my hand at creating the simplest recursion problem I could envision as a steping stone: the sum of ...
branco's user avatar
  • 193
3 votes
1 answer
122 views

I'm currently trying to implement Karatsuba Sqrt for my BigInteger module in luau, though I'm having trouble with its accuracy and I don't know what I'm doing wrong. Karatsuba function: local function ...
fosterchild's user avatar
0 votes
1 answer
131 views

I have the following recursive Python function. The goal is to return the index of the first occurrence of it in the list. Is it possible to fix this code within a maximum of 12 edits? def index_of(it,...
user32086462's user avatar
1 vote
1 answer
294 views

I’m trying to reason about a recursive algorithm on trees and I feel like I’m missing something subtle. I have an immutable binary tree (not a BST) where each node has an int value. I want to compute ...
sunmicrosystemsfan101's user avatar
1 vote
1 answer
180 views

I am getting what I believe is an infinite loop happening when I am trying to create view models from my model data, i.e. mapping them. The error I get is a 'stack overflow error'. I believe the ...
Nuvolari's user avatar
  • 1,195
2 votes
1 answer
107 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
4 votes
3 answers
198 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
174 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
203 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

15 30 50 per page
1
2 3 4 5
3162