Skip to main content
-1 votes
0 answers
64 views

I am trying to analyze and optimize recursive algorithms, particularly with regards to their time and space complexity. I have written a recursive solution for the Fibonacci sequence and a merge sort ...
Harsh Goyal's user avatar
0 votes
0 answers
46 views

I have a game with a frame counter which increments at a fixed rate, and my goal is for two instances of the game on different computers to sync this number so that they will have the same number at ...
Henry C's user avatar
  • 59
-3 votes
0 answers
58 views

Suppose we have an 𝑚*𝑛 grid, let 𝑖=0,...,𝑚−1 and 𝑗=0,...,𝑛−1. For each grid point we have an array 𝑆𝑖𝑗 of size 𝑁 that serves as local score function. We want to to find a way that assigns ...
Peter Wu's user avatar
  • 279
Advice
0 votes
2 replies
60 views

I have a problem where I need to cut off text based on a max length. But the inputted string could be html a la <p>hello</p>. the html tags do not count towards the max length. for example ...
Jacob Pecile's user avatar
4 votes
1 answer
151 views

I've been working on implementing some compression algorithms in C/C++ and JavaScript, I've started by building out LZSS. So far everything seems good. I check my dictionary buffer for matches, and if ...
Mornig Star's user avatar
Advice
1 vote
8 replies
131 views

Found this code exercise on W3R. Been trying to figure out the relationship between the outer and inner loop (i and j), but can't seem to wrap my head around it. If anyone could walk me through this ...
Stanislav Matveyevich's user avatar
-4 votes
0 answers
140 views

Imagine you get sequence of integers: [a1 a2 a3 ... an] where: 1 <= a <= 10^6 1 <= n <= 10^6 You are given a function f(x) that can change a number to the closest lower prime number, or ...
ToridFartFart's user avatar
2 votes
1 answer
117 views

I’m trying to solve the following Leetcode problem: You are given a 2D integer array intervals where intervals[i] = > [starti, endi] represents all the integers from starti to endi inclusively. A ...
Utkarsh Mishra's user avatar
0 votes
1 answer
207 views

I'm interesting in possible implementation approaches for a quite special variant of a list, with the following requirements: Efficient inverse lookup ("index of"): "give me an index ...
cubuspl42's user avatar
  • 8,601
Advice
1 vote
3 replies
76 views

I want to implement in python some algorithms from a paper that allow for a pre-trained neural network to be modified (adding or removing neurons or layers) conserving (theoretically) the outputs of ...
Rubén Sales Castellar's user avatar
6 votes
2 answers
300 views

I'm working on a problem where I need to count, for each possible common difference D, the number of contiguous subarrays whose elements can be rearranged to form an arithmetic progression with common ...
YAR's user avatar
  • 63
0 votes
0 answers
73 views

In the code block below is my current Negamax implementation, it is currently barebones. My question is why do Blocks 1 & 2 have to occur for a node that is expected to incur a beta-cutoff (i.e. ...
VHDLover's user avatar
0 votes
2 answers
75 views

I've been trying to teach myself various sort methods just for the sake of being able to use them in the future and right now I've been teaching myself about shell sorts. I understand the way shell ...
Neptunium-Eater's user avatar
0 votes
0 answers
60 views

I am working on a program that is supposed to build a tree using nested lists in Racket. I believe I am very close, but I am stuck on one section of my insertion testing process. The syntax for my ...
JoshLeonthe1st's user avatar
Advice
0 votes
3 replies
70 views

The context is implementing conversion functions between Gregorian calendar dates and Julian dates. Most (nearly all?) such implementations have restrictions on the dates - typically requiring that ...
John's user avatar
  • 1,673

15 30 50 per page
1
2 3 4 5
8100